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

Popular posts from this blog

javascript - Replicate keyboard event with html button -

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Web audio api 5.1 surround example not working in firefox -