coder9 Posted July 19, 2008 Share Posted July 19, 2008 hello the codes $tmp_name = 'user_box' . $link; $query = "UPDATE jtablegrid SET '$tmp_name'='$username' WHERE game_no = 1; mysql_query($query) or die(mysql_error()); thank you. Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted July 19, 2008 Share Posted July 19, 2008 No, the syntax is not correct. Field names should not be quoted with single quotes. Did you try it? <?php $tmp_name = 'user_box' . $link; $query = "UPDATE jtablegrid SET $tmp_name = '$username' WHERE game_no = 1; mysql_query($query) or die("Problem with the query: $query on line " . __LINE__ . '<br>' . mysql_error()); ?> Ken Quote Link to comment Share on other sites More sharing options...
coder9 Posted July 19, 2008 Author Share Posted July 19, 2008 No, the syntax is not correct. Field names should not be quoted with single quotes. Did you try it? <?php $tmp_name = 'user_box' . $link; $query = "UPDATE jtablegrid SET $tmp_name = '$username' WHERE game_no = 1; mysql_query($query) or die("Problem with the query: $query on line " . __LINE__ . '<br>' . mysql_error()); ?> Ken thank you KEN Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.