Getting multiple rows with prepared statement

后端 未结 3 1735
梦毁少年i
梦毁少年i 2021-01-05 18:35

I\'m quite new to prepared statements and am not sure I am doing this right.

Here is what I try:

$currgame = 310791;

$sql = \"SELECT fk_player_id, p         


        
3条回答
  •  抹茶落季
    2021-01-05 19:04

    Since I don't see it in your code, make sure you're instantiating the mysqli object before trying to query on it:

    $mysqli = new mysqli("127.0.0.1", "user", "password", "mydb"); 
    if($mysqli->connect_error){
        die("$mysqli->connect_errno: $mysqli->connect_error");
    }
    

    Also, a ServerError would certainly show up in your logs and point you in the right direction.

提交回复
热议问题