I am trying to create a new row to a database using insert into in a php script but after hours looking into it i am getting an error of “syntax error, unexpected T_LNUMBER”. I know that php screws it when it reach the “37bf7a30-b6cf-4642-89c9-031c1f6c34d0” string. I tried putting quotes and doublequotes there but nothing worked. Do you know any work arround maybe to help me out. Thanks a lot in advance and sorry for my bad english and the messy code.
mysql_query("INSERT INTO `bbdb_item` (`id`, `application_id`, `type`, `name`, `alias`, `created`, `modified`, `modified_by`, `publish_up`, `publish_down`, `priority`, `hits`, `state`, `access`, `created_by`, `created_by_alias`, `searchable`, `elements`, `params`)
VALUES ('$id',
'1',
'item',
'$name',
'$alias',
'$date',
'$date',
'42',
'$date',
'0000-00-00 00:00:00',
'0',
'0',
'1',
'1',
'42',
'',
'1',
' {\n
"37bf7a30-b6cf-4642-89c9-031c1f6c34d0": {\n "0": {\n "value": "http:\\/\\/www.xxxx.com\\/item\\/$id\\/overview.aspx",\n "text": "",\n "target": "0",\n "custom_title": "",\n "rel": ""\n }\n },\n
"d3d4559f-24eb-46b2-a749-068ebd3eceb3": {\n "0": {\n "value": "$id"\n }\n },\n
"0e366b7c-514a-4a37-b651-e6fe8edf78ff": {\n "0": {\n "value": "$country"\n }\n },\n
' {\n
"metadata.title": "",\n
"metadata.description": "",\n
"metadata.keywords": "",\n
"metadata.robots": "",\n
"metadata.author": "",\n
"config.enable_comments": "1",\n
"config.primary_category": "1"\n}')"
)
You have to escape all the double-quotes (
") like this:\".