Get values relative to values in another column
I want to select all custom values where the status is review
(there are four of them :) sky - earth - sea - sun
.
$stmt = $db->query("select user from posts where status = 'review'");
$rows = $stmt->fetch();
foreach ($rows as $row){
echo $row . '<br>';
}
Result:
sky
sky
I need:
sky
earth
sea
sun
Any help?
+3
source to share