使用PDO准备语句并执行语句

获得pdo预处理对象的方法:php $sql=“select * from user order by id”; $sth=$pdo->prepare($sql); 以上代码中的$sth即为预处理对象 在PDO中参数式的SQL语句有两种(预处理sql): 1.insert into stu(id,name) value(?,?); //?号式(适合参数少的) 2.insert into stu(i
相关文章
相关标签/搜索