1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

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