Echoing count results

wxdqz

New Member
This is my script and what I want to show is all the EventNames that will appear loads of times in the database only once in a table on a web page. So it will have the event name and then beside it will be the total number of occurrence that that particular EventName appears in the Database I don抰 know how to echo the total for each particular event name.

Any help is appreciated

$login="login";
$pass ="pass";
$db=mysql_pconnect("localhost",$login,$pass);
mysql_select_db("host",$db);

MySQL_select_db($db_name,$db);
$sql="select count(*) as Total, EventName from Photos GROUP BY EventName ";
$result=MySQL_query($sql,$db) or die("Bad query:".mysql_error());

while($myrow=MySQL_fetch_array($result))

{
$EventName=$myrow["EventName"];

echo "<TR ALIGN='LEFT' VALIGN='TOP'>";
echo "<TD><INPUT TYPE='TEXT' VALUE='http://www.phpbuilder.com/board/archive/index.php/$EventName' CLASS='CB-T-T11G'></INPUT></TD>";
echo "<TD><CENTER><INPUT TYPE='TEXT' VALUE='http://www.phpbuilder.com/board/archive/index.php/$Total' SIZE='1' CLASS='CB-T-T11G'></INPUT>";
echo "</TD></TR>";

Dashe
 
Back
Top