Whattya doing mate? Why the mish mash of vb and non vb related calls?
You have included global.php so you have access to $vbulletin->db. Dont go making another connection. Also you are making a connection but not assigning it to a variable
replace this...
If ($vbulletin->userinfo['userid']!=0)
{
} else {
echo "Please Login, <a href=\"login.php\">here</a>";
exit();
}
with
If (!$vbulletin->userinfo['userid'])
print_no_permission();
get rid of this
mysql_connect("localhost", "$database_user", "$database_pass") or die(mysql_error());
mysql_select_db("$database_db") or die(mysql_error());
replace this
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result)){
with this
$result = $vbulletin->db->query_read($query);
while($row = $vbulletin->db->fetch_array($result)){
|