Jump to content

insert query issue


never_rain

Recommended Posts

Hi,

 

I am facing a bit of problem. Here is the query.

 

$query1 ="INSERT INTO tbl_form (orderid, fieldName, fieldValue)
VALUES ('$p', '$res[size_name]', '$formItems["val1".$p]') ";

 

and I get the following error

 

1064 - 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 'Name, fieldValue=Faisal Niaz' at line 1

 

insert into tbl_form set orderid = 1, fieldName=Full Name, fieldValue=Faisal Niaz;

 

I was able to display the values but cant insert it. here is wot I used to display.

 

echo $res['size_name'].": ".$formItems["val1".$p]."<br>";

 

Problem is with this array item.

$formItems["val1".$p]

when I display it gives correct value but when I use it in the insert query, it gives the error. I assume there is some problem with Inverted Commas. I have been trying different options but couldnt resolve it. Please help.. Thanks Faisal

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.