Code: Select all
$result1=mysql_query("SELECT * FROM table WHERE name='myname'");
$result2=mysql_query("SELECT * FROM table ORDER BY name DESC");Moderator: General Moderators
Code: Select all
$result1=mysql_query("SELECT * FROM table WHERE name='myname'");
$result2=mysql_query("SELECT * FROM table ORDER BY name DESC");Code: Select all
$results=mysql_query("SELECT * FROM table ORDER BY name DESC");
$i = 1;
while ($current_result = mysql_fetch_array($results))
{ // this loop will get a result and store its data as an array in $current_result
print "This is result number $i and its name is " . $current_result['name'] . "<BR>";
$i++;
}