/* Database Stuff, do not modify below this line */
$connection = mysql_pconnect("$server","$db_user","$db_pass")
or die ("Couldn't connect to server.");
$db = mysql_select_db("$dbname", $connection)
or die("Couldn't select database.");
$table = "usersonline"; //Table where information is kept
$timeoutseconds = 300; //Recommended
When you say "it still fails on this line", do you mean that PHP crashes, or it displays "failed!" meaning that mysql literally failed the query?
Updating Bonzo's suggestion:
PHP Code:
$insert = mysql_db_query($dbname, "INSERT INTO $table ( time, ip, domain ) VALUES ('$time','$ip','$domain')") or die("Failed! <b>Mysql Said:</b><br><br>".mysql_error());
Just for debugging purposes, obviously you wouldn't show this extra information on your final site.