View Full Version : SQL Query from Control Panel
JamesUS
01-01-2002, 10:00 PM
This hack allows you to execute custom SQL queries from the control panel.
I know there are one or two other hacks that do this but this one is different in that it can also cope with 'SELECT' queries. Results are displayed in a table for select queries. Inspired by wluke's older version of this hack for vB 1.1.x, I have been using this succesfully for a few days now on my own forums.
Instructions
Upload attached 'query.php' file to the admin folder.
In admin/index.php, find:
makenavselect("Options","<hr>");
underneath, add:
makenavoption("Run Query", "query.php?t=0");
makenavselect("Database Maintanence", "<br>");
This hack copyright James Ussher-Smith © 2001 - 2002
Dalius
01-02-2002, 04:13 PM
This is VERY useful, thanks!
Dalius
01-02-2002, 04:42 PM
I did exactly what it sais but....
whats with the gap?
Lesane
01-02-2002, 04:52 PM
GREAT hack, thanks.
Originally posted by Dalius
I did exactly what it sais but....
whats with the gap? Remove the <br> after Database Maintenance if you want that gap to go away.
Originally posted by JamesUS
Inspired by wluke's older version of this hack for vB 1.1.x, I have been using this succesfully for a few days now on my own forums.Very nice, James! I've been using Wayne's hack for months. This version looks much more vB like. :)
Dalius
01-02-2002, 06:18 PM
Originally posted by FWC
Remove the <br> after Database Maintenance if you want that gap to go away.
thanks
DelusionalMind
01-06-2002, 10:57 PM
very nice :)
no more firing up phpmyadmin :)
Stretchr
01-16-2002, 03:19 PM
Nice job but unless I'm missing something, Chen (https://vborg.vbsupport.ru/member.php?s=&action=getinfo&userid=1) already wrote and posted a similar hack to this with a little more functionality:
https://vborg.vbsupport.ru/showthread.php?s=&threadid=26272
Ph0eniX
08-21-2002, 01:53 AM
I'm getting this when I click on "Run Query":
"CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:"
...any ideas?
ExAvIoUr
09-02-2002, 12:01 AM
Thank you, I really need this!
I get this error...
Warning: mysql_num_fields(): supplied argument is not a valid MySQL result resource in /home/public_html/forums/admin/query.php on line 27
Query Result - ALTER TABLE post ADD COLUMN nuked smallint(6) not null;
Warning: mysql_num_fields(): supplied argument is not a valid MySQL result resource in /home/public_html/forums/admin/query.php on line 29
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/public_html/forums/admin/query.php on line 33
Brahm
01-09-2003, 02:29 PM
Great hack JamesUS
S1R1US
02-13-2003, 01:42 AM
will this work with 2.2.9?
animi12
03-25-2003, 06:54 PM
02-12-03 at 09:42 PM S1R1US said this in Post #14 (https://vborg.vbsupport.ru/showthread.php?postid=353569#post353569)
will this work with 2.2.9?
I'd also like to know if this is compatible with 2.2.9. Thanks!
user360
03-26-2003, 01:23 AM
cool hack.
im getting the error
Warning: mysql_num_fields(): supplied argument is not a valid MySQL result resource in /home/virtual/site34/fst/var/www/html/iforum/admin/query.php on line 27
Query Result - ALTER TABLE bbcode CHANGE bbcodereplacement bbcodereplacement TEXT;
Warning: mysql_num_fields(): supplied argument is not a valid MySQL result resource in /home/virtual/site34/fst/var/www/html/iforum/admin/query.php on line 29
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/virtual/site34/fst/var/www/html/iforum/admin/query.php on line 33
im using 2.2.9
user360
03-27-2003, 03:17 AM
anyone?
monstergamer
03-27-2003, 04:31 AM
i get the same thing
using 2.3.0
user360
03-27-2003, 10:31 AM
is JamesUS still around?
"The hacker cannot guarantee to provide support for this hack."
Marzas
03-28-2003, 09:49 PM
can someone add a upgrade to it so we can run sql files as well, cuz i get really ++++ed of these type of things, i'm sure its not a hard thing to do.
Intex
03-31-2003, 01:37 PM
/me clicks Install. Thx for the hack.
GZ_Tanis
04-11-2003, 02:24 AM
03-28-03 at 06:43 PM Marzas said this in Post #21 (https://vborg.vbsupport.ru/showthread.php?postid=374713#post374713)
can someone add a upgrade to it so we can run sql files as well, cuz i get really ++++ed of these type of things, i'm sure its not a hard thing to do.
I am not at all a programmer but I did notice some spaces in very unusual places. I changed the query file and everything seemd to be working now try this copy here. BTW I am using 2.3.0 and it did work for me.
GZ_Tanis
04-11-2003, 02:28 AM
01-02-02 at 01:36 PM Dalius said this in Post #3 (https://vborg.vbsupport.ru/showthread.php?postid=210580#post210580)
I did exactly what it sais but....
whats with the gap?
To remove this gap change the code from the first post to this
makenavselect("Database Maintanence", );
chavalo2
04-24-2003, 05:24 AM
04-11-03 at 03:28 AM GZ_Tanis said this in Post #24 (https://vborg.vbsupport.ru/showthread.php?postid=380438#post380438)
To remove this gap change the code from the first post to this
makenavselect("Database Maintanence", );
Try
makenavselect("Database Maintanence");
to really correct the gap
MarkL
04-25-2003, 04:14 AM
Yeah, I upgraded to the new query.php file, but I still get this error whenever trying to run a query...
Database error in vBulletin Control Panel 2.3.0:
Invalid SQL: Array
mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'Array' at line 1
mysql error number: 1064
Date: Friday 25th of April 2003 01:13:12 AM
Script: harrypotter/harrypotter/admin/query.php[/url]
Referer: harrypotter/admin/query.php[/url]
Anyone know what the problem could be? :$ Plus, there goes the whole double directory thing again. i don't know why it's doing that. :$
mmmender
05-07-2003, 07:26 PM
i uploaded the new query.php file also and i'm still getting errors!
anyone?
csidlernet
06-02-2003, 08:22 AM
Thankyou very much!
WitchyT
09-04-2003, 06:51 AM
I'm getting errors too. :\ Although I'm not getting the double directory thing but I got the same error otherwise.
MaDCaT75
09-04-2003, 07:12 AM
Can anyone confirm that this works correctly?
lasto
09-04-2003, 07:44 AM
this one in this post works fine on 2.3
also read the full posts as it tells you info you need to know
https://vborg.vbsupport.ru/showthread.php?s=&threadid=50896&highlight=databse+queries
StrykerContact
09-04-2003, 10:02 PM
Very nice, thanks.
*Installed*
StrykerContact
09-05-2003, 11:02 PM
I am having problems, none of the queries I have ran work, I am going to uninstall this and replace it with fireflys. Sorry.
lasto
09-05-2003, 11:10 PM
Today at 01:02 AM StrykerContact said this in Post #33 (https://vborg.vbsupport.ru/showthread.php?postid=431653#post431653)
I am having problems, none of the queries I have ran work, I am going to uninstall this and replace it with fireflys. Sorry.
nothing to install ! just delete it from the admin folder thats all as its a stand alone and its runs every query ive thrown at it.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.