所以我有一个查询,但我想添加一个功能,用户可以“暂停”
$stmt212 = $db->prepare('SELECT *
FROM websites w
LEFT JOIN users u ON u.username = w.owner
WHERE u.coins >= ?
ORDER BY RAND()
LIMIT 1');
$stmt212->execute( array('1') ) ;
$row212 = $stmt212->fetch();
这项工作但现在我需要从网站中选择live = 1已经在用户表中有超过1的硬币确实试过这个
$stmt212 = $db->prepare('SELECT *
FROM websites WHERE live = ?
LEFT JOIN users u ON u.username = w.owner
WHERE u.coins >= ?
ORDER BY RAND()
LIMIT 1');
$stmt212->execute( array('1','1') ) ;
$row212 = $stmt212->fetch();
但没有工作
答案 0 :(得分:0)
试试这个:
$stmt212 = $db->prepare('SELECT *
FROM websites
LEFT JOIN users u ON u.username = w.owner
WHERE u.coins >= ?
AND live = ?
ORDER BY RAND()
LIMIT 1');
$stmt212->execute( array('1','1') ) ;
$row212 = $stmt212->fetch();