douzhengnao8265 2012-04-23 15:08
浏览 29
已采纳

Mysql意想不到T_LNUMBER

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', 
                                            ' {
   
                                            "37bf7a30-b6cf-4642-89c9-031c1f6c34d0":  {
        "0":  {
           "value": "http:\\/\\/www.xxxx.com\\/item\\/$id\\/overview.aspx",
          "text": "",
           "target": "0",
            "custom_title": "",
           "rel": ""
     }
 },
    
                                            "d3d4559f-24eb-46b2-a749-068ebd3eceb3":  {
        "0":  {
           "value": "$id"
        }
 },
    
                                            "0e366b7c-514a-4a37-b651-e6fe8edf78ff":  {
        "0":  {
           "value": "$country"
       }
 },
    
                                            ' {
   
                                            "metadata.title": "",
 
                                            "metadata.description": "",
   
                                            "metadata.keywords": "",
  
                                            "metadata.robots": "",
    
                                            "metadata.author": "",
    
                                            "config.enable_comments": "1",
    
                                            "config.primary_category": "1"
}')"
                                            )
  • 写回答

2条回答 默认 最新

  • doudong7256 2012-04-23 15:14
    关注

    You have to escape all the double-quotes (") like this: \".

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 import arcpy出现importing _arcgisscripting 找不到相关程序
  • ¥15 onvif+openssl,vs2022编译openssl64
  • ¥15 iOS 自定义输入法-第三方输入法
  • ¥15 很想要一个很好的答案或提示
  • ¥15 扫描项目中发现AndroidOS.Agent、Android/SmsThief.LI!tr
  • ¥15 怀疑手机被监控,请问怎么解决和防止
  • ¥15 Qt下使用tcp获取数据的详细操作
  • ¥15 idea右下角设置编码是灰色的
  • ¥15 全志H618ROM新增分区
  • ¥15 在grasshopper里DrawViewportWires更改预览后,禁用电池仍然显示