:age LIMIT :num";$map = ['age'=>16 , 'nmu'=>2];$res = Db::query($sql, $map);var_dump($res);Error message: SQLSTATE[HY093]: Invalid para"> 提示SQLSTATE[HY093]: Invalid parameter number: parameter was not defined-PHP Chinese Network Q&A
提示SQLSTATE[HY093]: Invalid parameter number: parameter was not defined
索马里海草
索马里海草 2020-02-15 23:47:07
0
1
2965

The code is as follows

$sql = "select * from user where age>:age LIMIT :num";
$map = ['age'=>16 , 'nmu'=> 2];
$res = Db::query($sql,$map);
var_dump($res);

Error message: SQLSTATE[HY093]: Invalid parameter number: parameter was not defined

Error message: [10501]SQLSTATE[HY093]: Invalid parameter number: parameter was not defined[D:\wwwroot\tp6.com\vendor\topthink\think-orm\src\ db\PDOConnection.php:722]

索马里海草
索马里海草

reply all (1)
phpcn_u88663

It has been solved. After reading the following tutorials, the teacher said that the parameters were undefined and the parameter transmission was wrong. Then I checked carefully and found that num was written incorrectly

    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!