Page 1 of 1

Would somebody look at this simple MySQL statement please?

Posted: Mon Sep 11, 2006 5:59 pm
by impulse()
I'm just getting into inserting data on a MySQL server from a PHP script and I can't see what's wrong with this update statement. Would someone mind pointing me in the right direction?

Code: Select all

include_once("/var/www/html/php/db/logon.php");

mysql_connect($host, $user, $pass);
mysql_select_db($db);

$query = mysql_query("UPDATE * SET timeAdded='Null' WHERE timeAdded=''") or die("I'm back" .mysql_error());
echo "<br>Update sucess";
Running the script returns
PHP Parse error: syntax error, unexpected T_STRING in /var/www/html/php/db/edit.php on line 10
Regards, Stephen

Posted: Mon Sep 11, 2006 6:03 pm
by feyd
The error says line 10, so the error is either there or on line 9 or whatever line is the previous statement.

Posted: Mon Sep 11, 2006 6:07 pm
by impulse()
I realise it's the MySQL statement (line 10) but I can't see what's wrong with it.

Posted: Mon Sep 11, 2006 6:10 pm
by Luke
impulse() wrote:I realise it's the MySQL statement (line 10) but I can't see what's wrong with it.
well we didn't because the SQL query is on line 6 (to us)

Posted: Tue Sep 12, 2006 3:03 am
by volka
And if I take the code snippet and have it tested by php -l, there's no syntax error. Your error is caused somewhere else (before that snippet).