Results 1 to 6 of 6
Thread: broken script (php/mysql)
-
03-28-2004, 10:18 AM #1Junior Guru Wannabe
- Join Date
- Aug 2003
- Posts
- 32
broken script (php/mysql)
Hi, I wonder if anyone can help me. I have this photo hosting script which isn't working. It has all been installed correctly, however I encounter the following error in the admin panel:
Warning: mysql_fetch_object(): The result type should be either MYSQL_NUM, MYSQL_ASSOC or MYSQL_BOTH. in /home/swift/public_html/fotohost/admin.home.php on line 141
Warning: mysql_fetch_object(): The result type should be either MYSQL_NUM, MYSQL_ASSOC or MYSQL_BOTH. in /home/swift/public_html/fotohost/admin.home.php on line 147
Can anyone shed any light on this or suggest any way to fix it?
Thanks in advance,
JamieJamie, http://www.ativi.com - jamie@ativi.com
AIM: Atividotcom | ICQ: 334982413 | MSN: msn@ativi.com | Yahoo: Atividotcom
-
03-28-2004, 11:30 AM #2Web Hosting Guru
- Join Date
- Aug 2002
- Posts
- 261
Your probably going to need a bit more than just the errors... A little bit of that scipt's code might be needed. Possibly like lines 135-155ish?
-
03-28-2004, 03:41 PM #3Junior Guru Wannabe
- Join Date
- Aug 2003
- Posts
- 32
Lines 130-151:
PHP Code:<?php
$query = mysql_query("SELECT member_name FROM member WHERE member_status = 'A'");
$rows1 = mysql_num_rows($query);
$query = mysql_query("SELECT member_name FROM member WHERE member_status = 'I'");
$rows2 = mysql_num_rows($query);
$query = mysql_query("SELECT member_name FROM member WHERE member_status = 'D'");
$rows3 = mysql_num_rows($query);
$query = mysql_query("SELECT image_id, image_size FROM image WHERE image_status = 'A'");
while($data4 = mysql_fetch_object($query, $db)) {
$size4 = $size4 + $data4->image_size;
}
$rows4 = mysql_num_rows($query);
$query = mysql_query("SELECT image_id, image_size FROM image WHERE image_status = 'D'");
while($data5 = mysql_fetch_object($query, $db)) {
$size5 = $size5 + $data5->image_size;
}
$rows5 = mysql_num_rows($query);
?>Jamie, http://www.ativi.com - jamie@ativi.com
AIM: Atividotcom | ICQ: 334982413 | MSN: msn@ativi.com | Yahoo: Atividotcom
-
03-28-2004, 08:11 PM #4Junior Guru Wannabe
- Join Date
- Aug 2003
- Posts
- 32
It's okay, I've managed to fix it now.
Jamie, http://www.ativi.com - jamie@ativi.com
AIM: Atividotcom | ICQ: 334982413 | MSN: msn@ativi.com | Yahoo: Atividotcom
-
04-01-2004, 08:18 AM #5Newbie
- Join Date
- May 2003
- Posts
- 19
What was the cause?
-
04-01-2004, 08:52 AM #6Junior Guru Wannabe
- Join Date
- Aug 2003
- Posts
- 32
I asked a friend if he knew how to fix it and he told me what to do.
I had to change "mysql_fetch_object($query, $db)" to "mysql_fetch_object($query)" and i specified $db at the top of the file.
I'm not really too sure if that is 100% correct, but thats all I can remember.Jamie, http://www.ativi.com - jamie@ativi.com
AIM: Atividotcom | ICQ: 334982413 | MSN: msn@ativi.com | Yahoo: Atividotcom