I have the following query that gets 3 rows from a table where ID = 1, 2 or 3. I then print out the columns of the matching rows - url & title.
$sql = "SELECT * FROM db WHERE id = \"1\" OR id = \"2\" OR id = \"3\" ;
$rs = mysql_query($sql,$conn);
while($row = mysql_fetch_array($rs)) {
echo "URL - ".$row['url']." Title - ".$row['title']." <br>";
}
How do I know what line refers to what ID, ie does the first line that is printed refer to the row where id = 1 or does it equal 2 or 3??
And i dont want to print out the ID and I only want to use the one SELECT statement.
I have tested this and it doesnt print out the results in the order of 1, 2, 3