$mes = mysql_query("select * from messages where to='".$user."'");
whenever i execute this sql query in the php script it says that there was an error in the syntax of the query near to = 'Joe' assuming that the user was joe. any ideas?
the syntax seems to be correct ... can you use 'to' as column name? try this:
$mes = mysql_query("select m.* from messages m where m.to='".$user."'");
not sure that "to" isn't a reserved word...
Yep. 'To' is a mysql reserved word.