Diffrent servers, diffrent problems

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Aaron
Forum Commoner
Posts: 82
Joined: Sun May 12, 2002 2:51 pm

Diffrent servers, diffrent problems

Post 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
Gen-ik
DevNet Resident
Posts: 1059
Joined: Mon Aug 12, 2002 7:08 pm
Location: London. UK.

Post 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);

?>
User avatar
AVATAr
Forum Regular
Posts: 524
Joined: Tue Jul 16, 2002 4:19 pm
Location: Uruguay -- Montevideo
Contact:

Post by AVATAr »

where does $user_properties['last_visit'] came from?...

are you sure it has some value in it?
Aaron
Forum Commoner
Posts: 82
Joined: Sun May 12, 2002 2:51 pm

Post by Aaron »

ahh, I hadnt changed the cookie path so it wasnt getting set, thansk alot ;)
User avatar
AVATAr
Forum Regular
Posts: 524
Joined: Tue Jul 16, 2002 4:19 pm
Location: Uruguay -- Montevideo
Contact:

Post by AVATAr »

;)
Post Reply