Help - Search - Members - Calendar
Full Version: I Need Help
Zymic Webmaster Forums > Zymic Free Web Hosting > Databases & MySQL
nandozz
my config:

$host = "localhost";
$user = "trab_zzl_org_nandozz";
$password = "mypassword";
$db = "trab_zzl_org_users";

the site is connected with database, but my php page doesnt load...dunno why wacko.gif

nandozz
QUOTE(Tom @ Jan 5 2008, 12:53 AM) *
Post all of the code.


<?php

error_reporting(E_WARNING);

$host = "localhost";
$user = "trab_zzl_org_nandozz";
$password = "";
$db = "trab_zzl_org_users";



$connect = mysql_connect($host, $user, $password)
or die (mysql_error());
$database = mysql_select_db($db)
or die (mysql_error());



$time = time();

$hour = time() - 60;



$IP = $_SERVER['REMOTE_ADDR'];



$URL = $_SERVER['PHP_SELF'];



$query = mysql_query(
"SELECT count(*) FROM users_online WHERE IP='$IP'");
$result = mysql_result($query,0,0);

if ($result)
{
mysql_query (
"UPDATE users_online SET time='$time',URL='$URL' WHERE IP='$IP'");
}

else
{
mysql_query (
"INSERT INTO users_online (time, IP, URL)
VALUES ('$time', '$IP', '$URL')");

$query = mysql_query("DELETE FROM users_online WHERE time<$hour");
$query = mysql_query("SELECT IP FROM users_online");

$result = mysql_num_rows($query);


$users = ($result <= 1) ? "" : "s";
}


echo "$result usuário${users} online";

?>
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.