Catchable fatal error: Object of class PDOStatement could not be converted to string in D

后端 未结 2 1502
遇见更好的自我
遇见更好的自我 2021-01-27 02:37

i have a problem that really warried me i create a website and I want my users first connect to the site, and then they fill information in a table, and then save the data and r

2条回答
  •  深忆病人
    2021-01-27 03:27

    The error message is pretty obvious: on the line of 45 you are trying to cast $response object into string. by trying either to echo it or concatenate or whatever. You have to get a data array out of response and then use it:

    $row = $reponse->fetch();
    

    Also note that using of die() is prohibited in general and especially useless with PDO which can die by itself, and perform it way better than if you kill it manually.

提交回复
热议问题