How to display external database data in VBulletin 4 Forums Custom PHP Block?

Posted by NJTechGuy on Stack Overflow See other posts from Stack Overflow or by NJTechGuy
Published on 2010-03-15T04:35:21Z Indexed on 2010/03/15 4:39 UTC
Read the original article Hit count: 334

Filed under:
|
|

Hi guys! I want to display data feed from an external database in a sidebar in the forums section.

PHP Block Code :

$host = 'db.123.net';
$dbUser = 'db49';
$dbPass = 'iReVbY';
$db = 'db6578h8';
mysql_connect("$host", "$dbUser", "$dbPass") or die(mysql_error());
mysql_select_db("$db") or die(mysql_error());
ob_start();
$result = mysql_query("SELECT id, title from abc") or die(mysql_error());
while($row = mysql_fetch_array( $result )) {
print"<center>";
print "<a href=\"http://abc.com/?id=" . $row['id'] . "\"></a>";
print "</center>";
}
$output .= ob_get_contents();
return $output;
ob_end_clean(); 

How do I return an array to display in a PHP block in the sidebar (forums section)?

Please help me out of this! Thank you..

© Stack Overflow or respective owner

Related posts about vbulletin

Related posts about php