php - get values regarding values in another column -
i want select user values status review
(there 4 of them: sky - earth - sea - sun
).
$stmt = $db->query("select user posts status = 'review'"); $rows = $stmt->fetch(); foreach ($rows $row){ echo $row . '<br>'; }
result:
sky sky
i need:
sky earth sea sun
any help?
since querying multiple records. $rows=$stmt->fetch()
1 record @ time need go while loop each records matching codition.
try this:
while ($rows = $stmt->fetch()) { echo $rows['user'] . '<br>'; }
Comments
Post a Comment