程式碼如下
$sql = "select * from user where age>:age LIMIT :num";
$map = ['age'=>16 , 'nmu'=> 2];
$res = Db::query($sql,$map);
var_dump($res);
錯誤提示:SQLSTATE[HY093]: Invalid parameter number: parameter was not defined
錯誤訊息:[10501]SQLSTATE[HY093]: Invalid parameter number: parameter was not defined[D:\wwwroot\tp6.com\vendor\topthink\think-orm\src\ db\PDOConnection.php:722]
已經解決,看了後面的教程,老師說是參數未定義,傳參錯誤,然後仔細檢查了下,原來是 num寫錯了