leo7068 Posted April 30, 2010 Share Posted April 30, 2010 Please help me troubleshoot this code which gives a Parse error: <? if (isset($_POST['submit'])) { $UpdateQueryonSubmit="UPDATE QA SET room_number = '{$_POST['room_number']}', TV = '{$_POST['TV']}', TV_Date = '{$_POST['TV_Date']}', mWave = '{$_POST['mWave']}', mWave_Date = '{$_POST['mWave_Date']}' WHERE room_number= $_POST['roomID']"; mysql_query($UpdateQueryonSubmit); } ?> Gives this error: Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING referring to line: room_number= $_POST['roomID']" Quote Link to comment https://forums.phpfreaks.com/topic/200306-table-that-updates-database-code-shown/ Share on other sites More sharing options...
jdavidbakr Posted April 30, 2010 Share Posted April 30, 2010 You're missing the curly braces around the $_POST['room_id'] Quote Link to comment https://forums.phpfreaks.com/topic/200306-table-that-updates-database-code-shown/#findComment-1051192 Share on other sites More sharing options...
leo7068 Posted April 30, 2010 Author Share Posted April 30, 2010 Thanks Jon, That fixed it. Silly mistake on my part, and good to have a fresh set of eyes to spot it right away. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/200306-table-that-updates-database-code-shown/#findComment-1051250 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.