Jump to content

[SOLVED] echo results?


MDanz

Recommended Posts

how do i echo 1st result, 2nd result, 3rd result? i know how to echo all of them, how do i echo the specific... e.g. 2nd result in query.

 

 

  $addz = mysql_query("SELECT * FROM Stacks WHERE username = 'Admin'")or die (mysql_error());

while($rowrun = mysql_fetch_array( $addz)) {
		  
$idz = $rowrun['id'];
		  
		  
		  }

Link to comment
https://forums.phpfreaks.com/topic/180319-solved-echo-results/
Share on other sites

use a counter?


$addz = mysql_query("SELECT * FROM Stacks WHERE username = 'Admin'")or die (mysql_error());
$i = 0;
while($rowrun = mysql_fetch_array( $addz)) {
		  
$idz = $rowrun['id']
if ($i == 2){//or i = whatever you want. this would be the third run of the loop
echo $idz;
}

$i++;
}

Link to comment
https://forums.phpfreaks.com/topic/180319-solved-echo-results/#findComment-951217
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.