Php Bug

Discussion in 'PHP' started by princesuhaib, Nov 25, 2008.

  1. #1
    Error type: 8: Undefined property: stdClass::$imagefile in /home/thequiz/public_html/admin/illusion.php at line 143

    Line 137 to 143 is:

    // check for presence of uploaded images
    if ( IsSet($_FILES["ThumbFileName"]))
    {
    $oldFileName = "";
    $result = executeSelection("select thumbfile from illusions where illusionId = $quizId");
    if ( $obj = mysql_fetch_object($result))
    $oldFileName = $obj->imagefile;

    but the red line is line 143

    please help!

    Thank You
     
    princesuhaib, Nov 25, 2008 IP
  2. bartolay13

    bartolay13 Active Member

    Messages:
    735
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    98
    #2
    bug? its an error.. check your class if $imagefile exist as a global variable..
     
    bartolay13, Nov 25, 2008 IP
  3. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #3
    See what's in the $obj. Looking at your code, there's no reason why: $obj->imagefile would work.

    if ( $obj = mysql_fetch_object($result))
    print_r($obj);

    Most likely you will need to use:
    $oldFileName = $obj->thumbfile;
     
    jestep, Nov 26, 2008 IP