MySql query?!
#1

Whats wrong with that PHP mysql query?


PHP код:
mysql_query("UPDATE TB_233 SET PR = '".$nn."' WHERE PR = '".$vn."'") or die(mysql_error()); 
Returns the follow error
Код:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TB_233 SET PR = 'Test' WHERE PR = 'testminusone'' at line 1
Reply
#2

I couldn't figure out any problems with that query, but here's some cleaner code I suggest you use.

PHP код:
mysql_query("UPDATE `TB_233` SET `PR` = '$nn' WHERE `PR` = '$vn'") or die(mysql_error()); 
My suggestions are to make sure that TB_233 and the PR column exist, and you are connected to the correct database.

I also HIGHLY suggest you convert to MySQLi. The old PHP_MySQL is deprecated and could cause severe compatibility problems with webhosts and servers using newer or older versions of PHP.
Reply
#3

I know, im testing on a old server..

The query seems fine but i still get errors

EDIT:

Seems working now with my code and your code.
BTW thanks for help but i didn't get out of that weird problem

+rep for you..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)