The script is suppose to read mysql table LogRedirect ... and classifie it by group(base on url) ... But i'd like to know how much times url as been shown ... so if www.php.net ... is group ... i need to know the number of time the url as been click
This is the script :
<?
//connect to mysql
//change user and password to your mySQL name and password
mysql_connect("localhost","","");
//select which database you want to edit
mysql_select_db("***");
//If cmd has not been initialized
if(!isset($cmd))
{
//display all the news $result = mysql_query("select URL, COUNT() FROM LogRedirect GROUP BY URL;");
$result = mysql_query("select , COUNT(*) FROM LogRedirect GROUP BY URL;");
//run the while loop that grabs all the news scripts
while($r=mysql_fetch_array($result))
{
//grab the title and the ID of the news
$ID=$r["ID"];//take out the title
$TS=$r["TS"];//take out the title
$URL=$r["URL"];//take out the title
$Source=$r["Source"];//take out the title
$ID=$r["ID"];//take out the id
//make the title a link = <a href='index.php?cmd=delete&id=$id'>Delete</a>
echo "$ID | $TS | $URL | $Source || ";
echo "<br>";
}
}
?>
<?
if($_GET["cmd"]=="delete")
{
$sql = "DELETE FROM LogRedirecte WHERE ID=$ID";
$result = mysql_query($sql);
echo "Row deleted!";
}
?>
Thanks for your help !
CAPT E !
:bemused: