Results 1 to 6 of 6
  1. #1

    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,
    Jamie
    Jamie, http://www.ativi.com - jamie@ativi.com
    AIM: Atividotcom | ICQ: 334982413 | MSN: msn@ativi.com | Yahoo: Atividotcom

  2. #2
    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?

  3. #3
    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

  4. #4
    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

  5. #5
    What was the cause?

  6. #6
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •