php - 2 Pdo Selects are they working? -
so asked on here few months ago own traffic exchange website users earn coins viewing other users websites , gain coins. on surf page grab random user there coins higher 1 grab 1 of there websites use. im wondering if both pdo selects linked ?? grabbing username first select second one?
$stmt9 = $db->prepare('select * users coins >= ? order rand() limit 1'); $stmt9->execute( array('1') ) ; $row = $stmt9->fetch(); $stmt212 = $db->prepare('select * websites w w.owner in (select u.username users u u.coins >= ?) order rand() limit 1'); $stmt212->execute( array($row['username']) ) ; $row212 = $stmt212->fetch();
variables messy know.
Comments
Post a Comment