Jump to content

Putting mysql row count to use.


tjmbc

Recommended Posts

<?php

$query = "SELECT COUNT(*) as phpsensei FROM table";
$result = mysql_query($query);

 while($row = mysql_fetch_object($query)){


     echo $row->phpsensei;


 }

?>

 

or

 

<?php

$query = "SELECT COUNT(*) as phpsensei FROM table";
$result = mysql_query($query);

 while($row = mysql_fetch_array($query)){


     echo $row[phpsensei];

 }

?>

 

 

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.