unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING error

后端 未结 6 1881
臣服心动
臣服心动 2020-11-30 06:45

i\'ve been staringly blanky at this error and can\'t seem to know what the problem is.When i run the query i get this error:

unexpected T_ENCAPSED_AND

6条回答
  •  暖寄归人
    2020-11-30 07:21

    Use { before $ sign. And also add addslashes function to escape special characters.

    $sqlupdate1 = "UPDATE table SET commodity_quantity=".$qty."WHERE user=".addslashes($rows['user'])."'";
    

提交回复
热议问题