Page 1 of 1

Diffrent servers, diffrent problems

Posted: Thu Oct 23, 2003 7:48 pm
by Aaron
Hi...

I have this query running...

Code: Select all

$query = mysql_query("SELECT time, tid, pid FROM $forumzDB.forumz_posts WHERE time > ".$user_properties['last_visit']." ORDER BY pid DESC");
It works fine on my server, but as soon as I test it on someone elses server I get mysql errors

Code: Select all

1 member & 0 guest online : 
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /mnt/sdb1/wfnetwor/public_html/Gaming/index.php on line 76

Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /mnt/sdb1/wfnetwor/public_html/Gaming/index.php on line 77
No new posts
I changed it to 30 as a test and it worked...

Code: Select all

$query = mysql_query("SELECT time, tid, pid FROM $forumzDB.forumz_posts WHERE time > 30 ORDER BY pid DESC") or die(mysql_error());
Do you know what the diffrence is in servers and why it works on mine and not his, I need to get it sorted..thx

Posted: Thu Oct 23, 2003 8:00 pm
by Gen-ik
I used to get those problems now and again but I switched to the method below and haven't had any trouble yet (fingers crossed). Not sure why or how it makes a difference but it does seem to.

Code: Select all

<?

$sql = "SELECT time, tid, pid FROM $forumzDB.forumz_posts WHERE time>{$user_properties['last_visit']} ORDER BY pid DESC");

$result = mysql_query($sql);

?>

Posted: Thu Oct 23, 2003 10:07 pm
by AVATAr
where does $user_properties['last_visit'] came from?...

are you sure it has some value in it?

Posted: Fri Oct 24, 2003 6:25 am
by Aaron
ahh, I hadnt changed the cookie path so it wasnt getting set, thansk alot ;)

Posted: Fri Oct 24, 2003 6:45 am
by AVATAr
;)