ardyandkari Posted August 28, 2008 Share Posted August 28, 2008 i want to replace the number of people ($people) allowed in a specific camp site ($site). this is my code: <?php $sql = "UPDATE `resort`.`cabins` SET `people` = ".$people." WHERE `cabins`.`number` = ".$site.";"; ?> it comes up with the following error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 what is wrong with the formatting of the mysql query? i copied this from phpmyadmin and removed some extraneous text (utf encoding, etc.)... thanks in advance... Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted August 28, 2008 Share Posted August 28, 2008 Echoing $sql would help. Are both the people and number columns defined as numeric data types? Quote Link to comment Share on other sites More sharing options...
ardyandkari Posted August 28, 2008 Author Share Posted August 28, 2008 wow...thanks a lot... i am so stupid...i didnt assign the hidden variable a value... thanks for making me think and for telling me to echo the query...i feel soooooo stupid. 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.