Page is a not externally linkable
- Code, Content, and Presentation
-- Databases
---- Strange Update syntax error


rocknbil - 5:53 pm on Sep 9, 2010 (gmt 0)


It shouldn't . . . . even though quoted aren't required on numeric fields it's still ok to quote them.


$query = "UPDATE main SET `". $coloumn ."`='" . $output[0] . "', `" . $coloumn . "t`='" . $output[1] . "' WHERE `name`='" . $name . "'";

or if these will always be integer fields,

$query = "alter table main change `" . $coloumn . "` `" $coloumn . "` int(11)";

$query = "alter table main change `" . $coloumn . "t` `" $coloumn . "t` int(11)";


Thread source:: http://www.webmasterworld.com/databases_sql_mysql/4197077.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com