PDA

View Full Version : Help with this code


Parker Clack
05-02-2006, 03:59 PM
When I insert


$customrowbanner = $db->query_read("SELECT id,banner_text FROM " . TABLE_PREFIX . "banner WHERE groupid=$foruminfo[forumid] ORDER RAND()");
$id=$customrowbanner['id'];
$text=$customrowbanner['banner_text'];
eval('$custombanner = "' . fetch_template('custombanner') . '";');
} else {
$custombanner = "";
}

in the forumdisplay_start hook I get

Parse error: parse error, unexpected '}'

Any ideas on how to write this to avoid this error message?

Thanks,
Parker

Moya
05-02-2006, 04:20 PM
This is kinda out of place I think

} else {
$custombanner = "";
}

Where is your IF clause?

Parker Clack
05-02-2006, 05:28 PM
I am sorry but I really don't know what you are referring to here. Can you give me an example of what you are talking about? I am way to new at PHP.

Thanks

Guest190829
05-02-2006, 06:04 PM
You have an Else clause but no If clause (which is needed), did you write this code or did you copy and paste it?

The syntax should look something like this:



If ( expression )
{
// some Code
}
Else
{
// Some other code
}

Parker Clack
05-02-2006, 09:32 PM
Sorry about that. I figured it out.

Thanks anyway.