mysqli prepared statement without bind_param

前端 未结 3 1491
予麋鹿
予麋鹿 2021-01-27 03:09

I have this code for selecting fname from the latest record on the user table.

$mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE);
$sdt=$mysqli-&g         


        
3条回答
  •  别那么骄傲
    2021-01-27 03:51

    If you want to execute it without bind, just use query

    $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE);
    $res = $mysqli->query('SELECT fname FROM user ORDER BY id DESC LIMIT 1');
    echo current($res->fetch_row());
    

提交回复
热议问题