View Full Version : How to run a query, using vBulletin code

22 Apr 2002, 00:44
I see alot of hackers asking in their hacks to add, alter, etc tables in order to make the specific hack work properly.
The problem is that not everyone knows how to run them and also that not alot of people like to install extra programs (phpmyadmin for example) in order to run only a query.

The easiest way is to use the vBulletin php code to do the job. Below is a .php file that I made to add the INFO table:<?php


$doquery="CREATE TABLE info (
infoid smallint(5) unsigned DEFAULT '0' NOT NULL auto_increment,
title char(100) NOT NULL,
PRIMARY KEY (infoid)


echo "Query successful.<br>";
echo "<font face='Courier' size='1'>$doquery</font>";

?>Now, all you have to do is change the highlighted code with your own, save the file, upload it to your /admin folder and run it.

It would be a good idea that every hacker who requiers table mods, to add this system to their hacks. ;)
Have fun with your code.

29 Apr 2002, 22:45
Hey there! thanks nakkid! Well... I use Firefly's hack to run a mysql query from the admin cp :)

Anyway, thanks for the tip! :D

08 May 2002, 08:44
for those who need firefly's hack, it can be found here (http://www.vbulletin.org/forum/showthread.php?s=&threadid=26272).

18 May 2002, 20:31
To use $DB_site withing admin/functions.php or a function() use

global $DB_site;