Forum Moderators: coopster

Message Too Old, No Replies

database problem

         

Heeren

12:21 pm on Aug 19, 2006 (gmt 0)

10+ Year Member



hello
i have design form in php and submit form . the error was occured is

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 ',,'fdgfdgfg@yttr.vc','','','2e9736689c933d57b92fae3d4ebf5041',''
pleae help me out
thanks

mack

12:25 pm on Aug 19, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Can you post the sql query you are trying to run. That may help us work out what went wrong.

(make sure you use general names no password ect :) )

Mack.

Heeren

12:26 pm on Aug 19, 2006 (gmt 0)

10+ Year Member



hello
query is
$sql="INSERT INTO customerinfo(first_name,last_name,address_1,address_2,city,cust_state,zipcode,country,phone,mobile,fax,email,accountname,howhearus,bkt_id,company_name) VALUES('$FirstName', '$LastName', '$AddressLine1', '$AddressLine2', '$City', '$County', '$Postcode', '$Country', $PhoneNumber, $MobileNumber, $FaxNumber, '$EmailAddress', '$AccountUsername', '$hear_about', '$bktid', '$company')";
thanks

[edited by: jatar_k at 6:34 pm (utc) on Aug. 19, 2006]
[edit reason]
[1][edit reason] fiexed sidescroll [/edit]
[/edit][/1]

Keepun

1:25 pm on Aug 19, 2006 (gmt 0)

10+ Year Member



Maybe:

$sql="INSERT INTO customerinfo(first_name,last_name,address_1,address_2,city,cust_state,zipcode,country,phone,mobile,fax,email,accountname,howhearus,bkt_id,company_name) VALUES(\'$FirstName\', \'$LastName\', \'$AddressLine1\', \'$AddressLine2\', \'$City\', \'$County\', \'$Postcode\', \'$Country\', $PhoneNumber, $MobileNumber, $FaxNumber, \'$EmailAddress\', \'$AccountUsername\', \'$hear_about\', \'$bktid\', \'$company\')";

[edited by: jatar_k at 6:35 pm (utc) on Aug. 19, 2006]
[edit reason]
[1][edit reason] fixed sidescroll [/edit]
[/edit][/1]

FalseDawn

2:55 pm on Aug 19, 2006 (gmt 0)

10+ Year Member



The problem is probably that you are missing single quotes around the phone and fax fields - if these variables are null (or empty strings), your SQL is going to be badly formed with 2 adjacent commas (as you have in your SQL)

You generally either need '' or NULL to represent "missing" data in an INSERT statement.

[edited by: FalseDawn at 2:56 pm (utc) on Aug. 19, 2006]