1 回答
TA贡献1818条经验 获得超3个赞
// while testing add
ini_set('display_errors', 1);
ini_set('log_errors',1);
error_reporting(E_ALL);
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
if (isset($_GET['id']))
{
$update = true;
$sql = "SELECT * FROM crimenews WHERE crimenews_id=?";
$stmt = $conn->prepare($sql);
$stmt->bind_param('i', $_GET['id']);
$stmt->execute();
$res = $stmt->get_result();
if($res->num_rows == 1)
{
// fetch_assoc() returns just an assoc array and not the numeric array as well
$row = $res->fetch_assoc();
$category = $row['crimenews_cat'];
$url = $row['crimenews_url'];
$datetime = $row['crimenews_datetime'];
$lat = $row['crimenews_locationLat'];
$lng = $row['crimenews_locationLong'];
}
}
- 1 回答
- 0 关注
- 142 浏览
添加回答
举报