Jump to content

What's wrong with this? >.< !


Tarte

Recommended Posts

mysql_connect(" ", " ", " ");mysql_select_db(" ");$retour = mysql_query('SELECT COUNT(*) AS nbre_entrees FROM news WHERE ip=\'' . $_SERVER['REMOTE_ADDR'] . '\'');$donnees = mysql_fetch_array($retour);if ($donnees['nbre_entrees'] == 0) {	mysql_query('INSERT INTO news VALUES(\'' . $_SERVER['REMOTE_ADDR'] . '\', ' . time() . ')');}else {	mysql_query('UPDATE news SET timestamp=' . time() . ' WHERE ip=\'' . $_SERVER['REMOTE_ADDR'] . '\'');}$timestamp_5min = time() - (60 * 5); // 60 * 5 = nombre de secondes écoulées en 5 minutesmysql_query('DELETE FROM news WHERE timestamp < ' . $timestamp_5min);$retour = mysql_query('SELECT COUNT(*) AS nbre_entrees FROM news');$donnees = mysql_fetch_array($retour);echo '<p>Il y a actuellement ' . $donnees['nbre_entrees'] . ' visiteurs connectés sur mon site !</p>';?>

I would tell you guys what Error i get, but it seems like there is error on pretty much every lines *lol* so..Thanks for helping me :)PS : I named it ''news'' for some dumb reason, but it has nothing to do with news, it's supposed to show statistic -.-

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...