View Full Version : mySQL/PHP Coding - Help selecting/applying values

28 Jun 2004, 12:32
Trying to write a hack that will allow custom overall headers based on forum (based on a similar hack found here). I've managed to get the forumdisplay part working correctly, but am having some trouble getting the custom header to show up in showthread.

I know I need to select the forumid from the thread table, and then apply that value towards the custom header (header being based on the forum you're in).

This is what I have to select forumid from the thread table:
$firstid = $DB_site->query_first("SELECT forumid FROM thread");

The part I can't figure out is how to take the value returned from that query and apply it towards the query for the custom header.

This is what I have for selecting whether or not to use the header and the value for the custom header, based on forum:
$mytop=$DB_site->query_first("SELECT enableheader,userheader FROM forum WHERE forumid=$firstid['forumid']");

Looking for any help here; I don't claim to be an expert :D.

28 Jun 2004, 15:32
Changed it to this:

$fid = $DB_site->query_first("SELECT forumid FROM thread");
$tig = $fid['forumid'];
$mytop=$DB_site->query_first("SELECT enableheader,userheader FROM forum WHERE forumid=$tig");

And it works :D