hi,
I want to make a logfile page with php,mysql but have a small problem with a code. I want for example:
I want that the script selects all "values" in the year field.
and tells my how many entrys are in the year 2003,2004,etc...
my current code is:
<?
$where = "year";
$connection=mysql_connect($db_svr,$db_usr,$db_pwd)or die("<font color=\"#ff0000\">ERROR: Server Not Found</font>");
$database=mysql_select_db($db_nme,$connection);
$list=mysql_query("select * from $tbl_logc",$connection);
echo"<table border=\"0\" align=\"center\">";
while($row=mysql_fetch_array($list))
{
$tellme = mysql_query("select $where from $tbl_logc");
$count = mysql_num_rows($tellme);
echo"<tr><td>$where: $row[$where]</td><td>visits: $count</td></tr>";
}
echo"</table>";
?>
this script doesn't work as it should do! The script make a new row for all entries in the DB, but it's not that what I want! I want to see only how many entries are in year 2003 and in a second row how many entries are in 2004.
If where = day than how many entries for day 1, 2, 3, ....
One per row! I hope you'll understand what i mean!