Correction status:qualified
Teacher's comments:把群里的作业要求看看
<?php try { $pdo = new PDO($dsn, $user, $password); } catch (PDOException $e) { exit('Connection failed:' . $e->getMessage()); }
<?php $pdo= new PDO('mysql:dbname=php','root','root'); $sql="select `id`, `name` ,`age` from `staff where `id`=:id"; $stmt=$pdo->prepare($sql); ?>
点击 "运行实例" 按钮查看在线实例
<?php $pdo= new PDO('mysql:dbname=php','root','root'); $sql="select `id`, `name` ,`age` from `staff where `id`=:id"; $stmt=$pdo->prepare($sql); ?>
点击 "运行实例" 按钮查看在线实例
<?php $pdo= new PDO('mysql:dbname=php','root','root'); $sql="select `id`, `name` ,`age` from `staff where `id`=:id"; $stmt=$pdo->prepare($sql); ?>
点击 "运行实例" 按钮
<?php $id=1; $stmt->bindValue(parameter:'id',$id,data_type:PDO::PARAM_INT) $stmt->bindParam(parameter:'id',$id,data_type:PDO::PARAM_INT) $stmt->execute();
点击 "运行实例" 按钮查看在线实例
<?php $id=1; $stmt->bindValue(parameter:'id',$id,data_type:PDO::PARAM_INT) $stmt->bindParam(parameter:'id',$id,data_type:PDO::PARAM_INT) $stmt->execute();
点击 "运行实例" 按钮查看在线实例
查看在线实例
<?php $pdo= new PDO(dsn:'mysql:dbname='php',username:'root',passwd:'root' BETWEEN :start AND :stop); $sql="select `id`,`name` from `staff` where `id`BETWEEN :start AND :stop"; $stmt=$pdo->prepare($sql); $start=2; $stop=5; $stmt->bindParam(parmeter:'start',&variable:$start,PDO::PARAM_INT); $stmt->bindParam(parmeter:stop,&variable:$stop,PDO::PARAM_INT); $stmt->execute();
点击 "运行实例" 按钮查看在线实例
<?php $pdo= new PDO('mysql:dbname=php','root','root'); $sql="select `id`, `name` ,`age` from `staff where `id`=:id"; $stmt=$pdo->prepare($sql); ?>
点击 "运行实例" 按钮查看在线实例
<?php $pdo= new PDO('mysql:dbname=php','root','root'); $sql="select `id`, `name` ,`age` from `staff where `id`=:id"; $stmt=$pdo->prepare($sql); ?>
点击 "运行实例" 按钮查看在线实例
点击 "运行实例" 按钮查看在线实例