【发布时间】:2020-07-07 10:58:13
【问题描述】:
数据库表名userclass有此列:user, class, date
$stmt = $conn->prepare("SELECT * FROM userclass WHERE user = :user");
$stmt->bindValue(":user", "James");
$stmt->execute();
我想获取用户为“James”的班级和日期的值并使用 php 打印出来
for($i=0; $i< the amount of row in which the user is 'James'; $i++){
echo the class from database;
echo the date from database;
}
我该怎么做?谢谢你的回答。。
【问题讨论】: