How to display external database data in VBulletin 4 Forums Custom PHP Block?
- by NJTechGuy
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..