01-11-2001, 01:17 PM
basically i'd like to input a thread name a la:
script.php?subject=Blah
and then do
$thread = "News: ".$subject;
and then pull the latest thread with that name out of the db, get its threadid, and print a header redirecting the person to that thread.
this isnt working though:
<?
require("global.php");
$title="News: ".$subject;
// echo "$title"; //debug
$threads = $DB_site->query("SELECT threadid FROM thread WHERE title=$title");
while ($thread = $DB_site->fetch_array($threads)) {
// echo "$thread[0]"; //debug
$url="http://www.tribalwar.com/forums/showthread.php?threadid=".$thread[0];
// echo "<a href=$url>test</a>"; //debug
header("Location: $url");
}
?>
it gives me a mysql syntax error, but i've no idea where it is.
this is for the newspro/vB integration, im working on a 'Comment on this news>>' link, and eventually i'd like to put the newsid in the thread\notes part of the table, but i thought i'd stick to this for now. any ideas?
script.php?subject=Blah
and then do
$thread = "News: ".$subject;
and then pull the latest thread with that name out of the db, get its threadid, and print a header redirecting the person to that thread.
this isnt working though:
<?
require("global.php");
$title="News: ".$subject;
// echo "$title"; //debug
$threads = $DB_site->query("SELECT threadid FROM thread WHERE title=$title");
while ($thread = $DB_site->fetch_array($threads)) {
// echo "$thread[0]"; //debug
$url="http://www.tribalwar.com/forums/showthread.php?threadid=".$thread[0];
// echo "<a href=$url>test</a>"; //debug
header("Location: $url");
}
?>
it gives me a mysql syntax error, but i've no idea where it is.
this is for the newspro/vB integration, im working on a 'Comment on this news>>' link, and eventually i'd like to put the newsid in the thread\notes part of the table, but i thought i'd stick to this for now. any ideas?