| We hope you enjoy your visit. You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free. Join our community! If you're already a member please log in to your account to access all of our features: |
| Sql error | |
|---|---|
| Tweet Topic Started: May 8 2005, 07:29 PM (345 Views) | |
| Das | May 8 2005, 07:29 PM Post #1 |
![]()
Smells of rich mahogany
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
I am new to sql so I don't see an error, but there is one:
I get
Am I missing something blantantly odvious? |
![]() |
|
| Seth | May 8 2005, 09:07 PM Post #2 |
|
I has a pony
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Yes. You have to send queries via mysql_query(). http://php.net/mysql_query |
![]() |
|
| Das | May 8 2005, 09:12 PM Post #3 |
![]()
Smells of rich mahogany
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
How would mysql_query() be used in this instance? I thought query was used to get infromation. I am trying to Create the table not get anything from it. Sorry for being a n00b if I am missing something. |
![]() |
|
| Ben | May 8 2005, 09:18 PM Post #4 |
|
Quantum-locked when observed.
![]()
|
A query is used for anything that will alter the database:
|
![]() |
|
| Das | May 8 2005, 09:22 PM Post #5 |
![]()
Smells of rich mahogany
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
EDIT: Figured it out, but now a new question.
I am trying to see if everything worked properly. I keep getting an error on "$password = $ACCOUNT_INFORMATION['password'];" . Do I need to query it too? |
![]() |
|
| Ben | May 8 2005, 09:34 PM Post #6 |
|
Quantum-locked when observed.
![]()
|
Missed a semicolon: ![]()
|
![]() |
|
| Das | May 8 2005, 09:41 PM Post #7 |
![]()
Smells of rich mahogany
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Now all I get is how come the password isn't dispylaing? Also is there a way to see if something is already in the database? EX: if ($bob == 'script to check if it is already in the db') { ... |
![]() |
|
| JoeC | May 8 2005, 10:13 PM Post #8 |
|
Euch! IE tastes horrible!
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
I don't do PHP and SQL, but in the original script:
Do you not need to do something like (not sure of syntax)
As I say, I''m not sure that'll work, but it may be worth a try. |
![]() |
|
| Das | May 8 2005, 10:20 PM Post #9 |
![]()
Smells of rich mahogany
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Actually it would be
It doesn't work, but good thought
|
![]() |
|
| Seth | May 8 2005, 10:21 PM Post #10 |
|
I has a pony
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Variable names are case sensitive. Das, your example is bad. However either method should work. Check your result variable to see if it returns > 0. |
![]() |
|
| Das | May 8 2005, 10:25 PM Post #11 |
![]()
Smells of rich mahogany
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
EDIT: I think I delete my old incorrect one, but now it still isn't showing up. Is there a way I can delete everything and try again? |
![]() |
|
| JoeC | May 8 2005, 11:20 PM Post #12 |
|
Euch! IE tastes horrible!
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Run the SQL query "drop" on your table, and it'll delete all the contents, then insert a new record. Or, if you can use something like PHPmyAdmin, that's really easy to get rid of stuff in. |
![]() |
|
| Das | May 8 2005, 11:21 PM Post #13 |
![]()
Smells of rich mahogany
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
I just killed the entire database. I will try again when I learn more. |
![]() |
|
| JoeC | May 9 2005, 12:21 AM Post #14 |
|
Euch! IE tastes horrible!
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
I did say that was what "drop" did. I don't know much, but I know that. I'm kinda hoping the db wasn't important, and if it was just a testing one, then if you add a new record, you can use this:
And then do your outputting off that. |
![]() |
|
| 1 user reading this topic (1 Guest and 0 Anonymous) | |
| « Previous Topic · Technology Chat · Next Topic » |
| Track Topic · E-mail Topic |
8:35 AM Jul 11
|




![]](../../../../0/1/0/p601690/pipright.png)





8:35 AM Jul 11