MySQL查询:
$sSix = "SELECT count(*) as count FROM `timers` WHERE `real_id` = {$row['real_id']}";
$rSix = mysql_query($sSix, $conn2);
echo mysql_error(); die;
结果: 未知栏' 985_1445542200'在' where子句'
列名称为real_id
,但结果显示列' 985_1445542200'。
请您告诉我可能的错误原因。
答案 0 :(得分:5)
WHERE
部分需要引号。像这样:
$sSix = "SELECT count(*) as count FROM `timers` WHERE `real_id` = '{$row['real_id']}'";
此外,请考虑使用较新的mysqli_
函数或PDO
,因为旧的mysql_
函数将来会停止工作。
答案 1 :(得分:0)
$respons = array();
$i = 0;
while ($row = mysql_fetch_assoc($result)) {
$respons[$i]["error"] = FALSE;
$respons[$i]["WinnerInfo"]["price"] = $row["price"];
$respons[$i]["WinnerInfo"]["level"] = $row["level"];
$respons[$i]["WinnerInfo"]["win_date"] = $row["win_date"];
$respons[$i]["WinnerInfo"]["payed"] = $row["payed"];
$respons[$i]["WinnerInfo"]["pay_date"] = $row["pay_date"];
++$i;
}