PDA

View Full Version : query problem...


FlyingDutchman
09-15-2002, 03:24 PM
i've this code:

$threadz = $DB_site->query("SELECT title,originalforumid,threadid FROM thread WHERE forumid='5'");

if (!$DB_site->num_rows($threadz)) {
print '<br>No threads found.</b>';
} else {
while ($thread_info = $DB_site->fetch_array($threadz)) {
extract($thread_info);
print '<br><b>'.$threadz[title].'</b> - <a href="../postings.php?action=restore&threadid='.$threadz[threadid].'&s='.$session[sessionhash].'">[restore]</a>'.$threadz[originalforumid].'';
}
}

but, it just doesn't work like i want it to...
where i print the variables, there's nothing?
please anyone help me...
thanks!
:rolleyes:

Xenon
09-15-2002, 04:02 PM
try this one instead:
$threadz = $DB_site->query("SELECT title,originalforumid,threadid FROM thread WHERE forumid='5'");

if (!$DB_site->num_rows($threadz)) {
print '<br>No threads found.</b>';
} else {
while ($thread_info = $DB_site->fetch_array($threadz)) {
extract($thread_info);
print '<br><b>'.$thread_info[title].'</b> - <a href="../postings.php?action=restore&threadid='.$thread_info[threadid].'&s='.$session[sessionhash].'">[restore]</a>'.$thread_info[originalforumid].'';
}
}

FlyingDutchman
09-15-2002, 04:20 PM
oopz :)
well, mucho thanks man!
i just dunno why i just can't code (do anything really, not just pc things) without making small error/fauls :(
again thanks!!!

Xenon
09-15-2002, 06:48 PM
np

small faults are the faults even the best can produce ;)