Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MySQL/PHP - SQL UPDATE statement

Status
Not open for further replies.

BettyJo50

Technical User
Apr 25, 2002
47
0
0
US
Hi. I am trying to update one field in my table in MySQL. I cannot get this field to update. Can someone possibly tell me what is wrong with my SQL statement?

$SQL="UPDATE umcritsurv SET IQ_Use_Q9='$IQ_Use_Q9' WHERE fldAuto='54'";

Thank you!!!
 
Well, actually, it doesn't give me any errors. It moves on to the next page as though it has inserted it into my database. But when I look, the info for that field is still blank.
 
I'm sorry!! I'm not sure what you mean by that. (I'm still trying it learn this). Where could I find this?
 
I am using PHP with an Apache server.
 
Then I recommend that you take a look at the online manual page for mysql_query()

That page will tell you what return from mysql_query() to expect when the function returns an error.

It may also be that the query is well-formed, yet simply does not affect any records. If I use a statement like "UPDATE foo SET bar=3 WHERE baz=4" and no records have a column baz containing the value 4, then no records will be updated.

I also have a FAQ in the PHP forum on debugging code: faq434-2999

Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top