richiejones24 Posted December 5, 2011 Share Posted December 5, 2011 I have been pulling my hair out for the lasy 3 hours i am trying to update a MySql table but i cant get it too work, i just keep getting MySql error #1064 - You have an error in your SQL syntax; if i just update 1 field it works fine but if i try to update more than 1 field it dosent work, Help Please! <?php $root = $_SERVER['DOCUMENT_ROOT']; require("$root/include/mysqldb.php"); require("$root/include/incpost.php"); $con = mysql_connect("$dbhost","$dbuser","$dbpass"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("$dbame", $con); mysql_query("UPDATE Reg_Profile_p SET build='$build' col='$col' size='$size' WHERE uin = '$uinco'"); ?> Quote Link to comment https://forums.phpfreaks.com/topic/252539-mysql-update-not-working-error-1064-you-have-an-error-in-your-sql-syntax/ Share on other sites More sharing options...
awjudd Posted December 5, 2011 Share Posted December 5, 2011 You are missing commas between each of the fields you are setting. mysql_query("UPDATE Reg_Profile_p SET build='$build' , col='$col' , size='$size' WHERE uin = '$uinco'"); ~awjudd Quote Link to comment https://forums.phpfreaks.com/topic/252539-mysql-update-not-working-error-1064-you-have-an-error-in-your-sql-syntax/#findComment-1294757 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.