Helpful Information
 
 
Category: vBulletin 3 Articles
How to run a query, using vBulletin code

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
error_reporting(7);
require("./global.php");

cpheader();

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

$DB_site->query("$doquery");

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

cpfooter();
?>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.

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

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

To use $DB_site withing admin/functions.php or a function() use


global $DB_site;










privacy (GDPR)