Grazie per le risposte,
intendi fare una pagina dove metto tutte le richieste per il db update inser e delete e poi le richiamo al momento del bisogno?
Sto imparando e mi accorgo ogni volta che non sono oredinato nel programmare, ma ogni volta che lo faccio sistemo per il meglio hehehe !!
Alla fine ho risolto cosi al momento che si logga l'utente nella pagina member faccio eseguire la funzione:
Codice PHP:
function adduserStat()
{
$uid = $_GET['uid'];
$ip = $_SERVER['REMOTE_ADDR'];
$agent = $_SERVER['HTTP_USER_AGENT'];
$host = $_SERVER['HTTP_HOST'];
$url = $_SERVER['REQUEST_URI'];
$time = time();
$sql= "SELECT * FROM tbl_stats WHERE lg_id = $uid";
$query = mysql_query($sql) or die (mysql_error());
$result = mysql_fetch_assoc($query);
$numrows = mysql_num_rows($query);
echo $numrows;
if($numrows == 0)
{
$sql = "INSERT INTO tbl_stats (lg_id, sta_ip, sta_agent, sta_host, sta_url, sta_time) VALUE ('$uid', '$ip', '$agent', '$host', '$url', '$time')";
$query = mysql_query($sql) or die (mysql_error());
}
else
{
$sql = "UPDATE tbl_stats SET lg_id = '$uid', sta_ip = '$ip', sta_agent = '$agent', sta_host = '$host', sta_url = '$url', sta_time = '$time' WHERE lg_id = $uid";
$query = mysql_query($sql) or die (mysql_error());
}
}
E funziona come voglio io!!!
Consigli sono sembre i beneveuti!!
Grazie Michel