Welcome to WebmasterWorld Guest from 54.167.159.180

Forum Moderators: mack

Message Too Old, No Replies

Sql Relationship problem

     
5:10 pm on Jan 28, 2004 (gmt 0)

Junior Member

10+ Year Member

joined:July 15, 2003
posts:51
votes: 0


Iam tryin to place a live forum update colom on my page using php.

From using a yabbse board it has left me with numerous tables in my database.

By using 1 of the tables iam able to get the right url: But i need to reference it with another table so i can the subject correct aswell:

$dbcnx = @mysql_connect('localhost', 'root', '');
if (!$dbcnx) {
die( '<p>Unable to connect to the ' .
'database server at this time.</p>' );
}


if (! @mysql_select_db('yabb') ) {
die( '<p>Unable to locate the Yabbse ' .
'database at this time.</p>' );
}

$sql = "SELECT * FROM yabbse_topics ORDER BY ID_FIRST_MSG DESC";

$result=mysql_query($sql);

$num=mysql_numrows($result);

$i=0;
while ($i < 4) {

$boardId=mysql_result($result,$i,"ID_BOARD");
$msgId=mysql_result($result,$i,"ID_FIRST_MSG");
$topID=mysql_result($result,$i,"ID_TOPIC");

echo "<a href=http://www.%%%%%%.co.uk/yabbse/index.php?board=$boardId;action=display;threadid=$topID>Forum Subject: $boardId</a><br>";

++$i;
}
?>

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members