scotch33 Posted January 31, 2007 Share Posted January 31, 2007 Hi,I am getting this - 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 'invoiceno='123456', amount='23.00', name='test', email='john@john.co.uk', phone=' at line 3when using the following code - [code] $sql_insert = "INSERT INTO payment_records SETrand_code='$randcode'invoiceno='$invoiceno',amount='$amount',name='$name',email='$email',phone='$phone',companyname='$companyname',billingaddress='$billingaddress',billingpostcode='$billingpostcode',addresschange='$addresschange'";[/code]apparently the version of mysql has recently been upgraded to 4.3.10 - I have tried to find refernce to any difference in comands but haven't had a lot of luck. Can anyone point me in the right direction? Quote Link to comment Share on other sites More sharing options...
webren Posted January 31, 2007 Share Posted January 31, 2007 Try using...[code]$sql_insert = "insert into payment_records values('$randcode', '$invoiceno', '$amount', $name', $email', $phone', $companyname', $billingaddress', '$billingpostcode', $addresschange'";[/code]...if you're placing the values into all of the table columns. If you're not placing the values into all of the columns in your table, then you need to specify which colums to insert by...[code]$sql_insert = "insert into payment_records(columns go here) values('$randcode', '$invoiceno', '$amount', $name', $email', $phone', $companyname', $billingaddress', '$billingpostcode', $addresschange')";[/code] Quote Link to comment Share on other sites More sharing options...
paul2463 Posted January 31, 2007 Share Posted January 31, 2007 you are missing a comma after rand_code='$randcode' Quote Link to comment Share on other sites More sharing options...
scotch33 Posted January 31, 2007 Author Share Posted January 31, 2007 Doh! Thanks guys! 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.