Dear Phpers,

I have the following part of a script that retrieve an URL site. I'd like
to count the clicks for every URL. I have added to mysql table a column
"hit". May anybody tell me how to insert into an sql selection also an
update, referring to the HIT variable (i.e. to realize a select and update
together) ?

This is the select I'm using:

$link = mysql_connect($host,$user,$password);
$result=mysql_db_query($base,"select url from ".$baseofsites." where
id=".$s." ",$link);
$url = mysql_result($result,0,"url");
header("Location: ".$url."");

This should be (I suppose) the sql update I must include ... UPDATE
table.sites SET hit = hit + 1 WHERE id=$s 

Thanks for all, Alessandro

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to