Sunday, 11 August 2013

While Using Or in MYSQLI choose which comes first?

While Using Or in MYSQLI choose which comes first?

When you retrieve data like so, is there a way to say output the selected
'both' first?
Would this be as simple as re arranging the order of the WHERE portion?
$sqls = "SELECT * FROM course WHERE course='$product_id_array' OR
course='Both' ORDER BY id DESC";
$sqlsresults = mysqli_query($db_conx,$sqls);
while($row = mysqli_fetch_assoc($sqlsresults)){
$selectedContent = $row["content"];
$selectedTitle = $row["title"];
}

No comments:

Post a Comment