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

后端 未结 2 1526
遇见更好的自我
遇见更好的自我 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

    Your first line should read $id= $_SESSION['idCommercant'] (I suppose)

    As it stands now a single line comment is started right after the = sign. Excecution proceeds on the next line and assigns the value of $response (a PDOStatement) to $id.

    In the last line you try to pass this as a parameter to $response->execute() which expects an array of strings, but an array with a PDOStatement is given. It cannot be converted, hence the error.

提交回复
热议问题