2 回答
TA贡献1798条经验 获得超3个赞
您可以使用PDOid=1
通过以下方式获取分配的任务
$id = 1;
$sql = "SELECT task FROM your_db_table WHERE `id` = :id ";
$sql ->execute([ 'id' => $id]);
$task= $sql;
如果你使用的是mysqli
$id = 1;
$stmt = $dbConnection->prepare('SELECT task FROM your_db_table WHERE id =?');
$stmt->bind_param('i', $id); // 'i' specifies the variable type => 'integer'
$stmt->execute();
$result = $stmt->get_result();
$text= $result->fetch_assoc();
TA贡献1883条经验 获得超3个赞
试试这个
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
$mysqli_connect = mysqli_connect("localhost", "root", "", "hexll");
$sqlquery= mysqli_query($mysqli_connect,"select text from mytable where id='1' ");
$row= mysqli_fetch_array($sqlquery, MYSQLI_ASSOC);
echo $row['text'];
- 2 回答
- 0 关注
- 96 浏览
添加回答
举报