vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   [RELEASE v2] Run a SQL query directly from your admin contorl panel (https://vborg.vbsupport.ru/showthread.php?t=26272)

Admin 08-23-2001 10:00 PM

Description:
I see a lot of people here who are trying to fix a problem or install a hack, sometimes requires them to run a SQL query on their database, and just don't know quite how.
I know you can use Telnet, but not everyone has access, and I know there's phpMyAdmin, but who needs all that when you just need to update a table or add a field.
Of course running select queries with this is not very useful, but I'm working on changing that.


Main Features:
- Run a single query
- Run multiple queries
- Option to show / not show query after execution
- Confirmation page


Demo:
1.
http://forum.t-cove.com/query1.gif
2.
http://forum.t-cove.com/query2.gif
3.
http://forum.t-cove.com/query3.gif
4.
http://forum.t-cove.com/query4.gif


Installation:
1. Unzip query.php from the attached zip file and upload to your admin folder.

2. In index.php (under your admin folder), replace
PHP Code:

<tr><td>
<table width="100%" border="0" cellspacing="0" cellpadding="2" id="navtable">
<?php maketableheader("Options"); ?>
</table>
<a href="options.php?s=<?php echo $session[sessionhash]; ?>&action=options"> Change options </a>
</td></tr>

with
PHP Code:

<tr><td>
<table width="100%" border="0" cellspacing="0" cellpadding="2" id="navtable">
<?php maketableheader("Options"); ?>
</table>
<a href="options.php?s=<?php echo $session[sessionhash]; ?>&action=options"> Change options </a>
</td></tr>

<tr><td>
<table width="100%" border="0" cellspacing="0" cellpadding="2" id="navtable">
<?php maketableheader("SQL Queries"); ?>
</table>
<a href="query.php?s=<?php echo $session[sessionhash]; ?>"> Run a SQL query </a>
</td></tr>


That's it - can it get any more simple? :)
Feedback, requests, future ideas and anything else is more than welcome. :D

joecrow 08-24-2001 08:08 AM

kool thanks for the hack m8 keep up the good work.

Bane 08-24-2001 08:08 AM

Great Idea FireFly! Off to install this one :) Great thinking.

orca 08-24-2001 09:20 AM

Agree with Bane

/me is off installing...

orca 08-24-2001 09:32 AM

Worked like a charm. But I have a suggestion:

If I want to run a query which gives a result, e.g. the example query from mySQL
Code:

select BENCHMARK(1000000,encode("hello","goodbye"));
it should display the result. Now it only repeats the query again since I set this option to yes.

Admin 08-24-2001 10:34 AM

Thanks all for the comments.

[QUOTE]Originally posted by FireFly
Of course running select queries with this is not very useful, but I'm working on changing that.

Thomas P 08-24-2001 02:15 PM

As far as I know he's male (right?)
Great hack btw :D
-Tom

eva2000 08-24-2001 02:15 PM

interesting hack.. :)

butty 08-24-2001 02:51 PM

great hack, so easy 2 install even me gran could have installed it!! :)

Admin 08-24-2001 08:16 PM

I've been working on this alot today.
I wanna go to sleep, and I don't have time to create new screen shots, edit posts and such, so I'm just going to post this new file here and when I wake up I'll sort everything.

This has support for basic queries, such as
Code:

SELECT ... FROM ... WHERE
Basically almost everything, except for AS. Don't try using AS, it will not work.

To install this simply upload the new file and overwrite the old one.

A basic screen shot is available in the zip file. *yawn*

Please post any feedback and suggestions about this, so I could fix / add anything to the new re-release! Thanks! :)

Wayne Luke 08-24-2001 09:19 PM

This isn't as fancy but it can run every query MySQL can process. It gives columnized results and it works on all versions of vBulletin. This is probably my first hack ever for vBulletin and I have been using it successfully for the last year.

Just rename it query.php and put a link for it in index.php.

Admin 08-25-2001 06:26 AM

So you're saying I wasted a day of my life? :p
Thanks Wayne. :)

orca 08-25-2001 07:18 AM

Quote:

Originally posted by FireFly
Orca, I'll see what I can do. :)
(btw, are you a female or a male? I've been wondering for days now :p)

Just checked: Still all male. ;)

Pie'oh'pah 08-25-2001 10:50 AM

Thumbs up dude

This is some serious hack! Small, easy to do and running fine! :D

Thnx

-Alex

webhost 08-25-2001 03:51 PM

Thanks For the hack Firefly, This will make things alot easier.

Fred 09-24-2001 03:26 AM

Got a weird error. I did what you said, then when I clicked on the link on the side to add a query. It went to the page, and above it all had this:
Code:

Fatal error: Call to undefined function: getrowbg() in /usr/accountname/forum/admin/query.php on line 66

[VbbFr]Elie 09-24-2001 04:58 AM

It's looking to work but what horible look (wluke file)
One small problem ... If there is HTML in table, there is not keep caracter and translate in HTML in the page ...

Sorry about my bad english :)

GetMeHosted.com 09-24-2001 05:34 PM

Simple, and a all around Great Feature!

Thanks...

God Bless,

Mike Gaidin 09-24-2001 10:03 PM

Great hack FireFly!!!! :D

I love this one. Good job!

JJR512 09-24-2001 10:20 PM

This is a good idea, but it definitely needs some way to view the output. For example, I'd like to be able to run this query and see the list it gives me:
SELECT username FROM user WHERE dct='X' ORDER BY username ASC
(Which involves a custom field in my user table.)

cyrus 09-25-2001 09:28 AM

Is this similar to TELNET ?? ( which I have but it would be easier to do it through here ! )

Also, how acn I make a DB BACKUP through this ??

thanks

Admin 09-25-2001 12:19 PM

JJR512, I understand that the code wluke posted does that.
Like he said, it's not fancy or anythin, but works.

Cyrus, no, not really.
This is more like (a very very lite version of) phpMyAdmin, not Telnet.
Although most of the commands you can use in Telnet you can use here (SELECT, UPDATE, INSERT, DELETE, ALTER queries, stuff like that), I'm not sure how you can do a backup from here.
And don't forget there is a backup utility in vBulletin. :)

JJR512 09-26-2001 04:20 AM

I have had an error with wluke's version. I don't know if there was a thread for that or not, so I don't know where else to put this but here, sorry.

This is the query I attempted to run:
SELECT username FROM user WHERE dct='2' ORDER BY username ASC

This is the error message I received:
Quote:

Database error in vBulletin Control Panel: Invalid SQL: E
mysql error: You have an error in your SQL syntax near 'E' at line 1
mysql error number: 1064
Date: Wednesday 26th of September 2001 01:16:53 AM
Script: /forums/admin/query.php?action=run
Referer: http://216.118.105.52/forums/admin/w-query.php

JohnBradshaw 09-26-2001 08:15 AM

This has got to be one of the best hacks I have ever seen! Much better then having sort out MyAdmin!

YourHostSucks 09-27-2001 07:04 PM

This is very handy and works like a charm (most of the time) :)

Thanks!

TheComputerGuy 11-04-2001 11:29 AM

This is just the update for 2.20 Enjoy...Follow all other instructions

In the admin/index.php
Find:
// ***
makenavoption("Add","announcement.php?action=add", "|");
makenavoption("Modify","announcement.php?action=mo dify");
makenavselect("Announcements");
// ***

Above that place this:
makenavoption("Run MySQL","query.php?s=<?php echo $session[sessionhash]; ?>");
makenavselect("MySQL Query");

And save and upload

And upload the Query.php to your admin folder....

Enjoy...
Chris

xug 11-04-2001 05:12 PM

Very Cool Hack

Thank you FireFly.

|DarkManX| 11-04-2001 06:05 PM

thanks GREAT HACK!!

SirSteve 11-08-2001 01:46 AM

Works great!

Harvey 03-20-2002 11:28 AM

just another query.php, if I may post it.

features:
- run nearly every command MySQL understands
- select the database
- HTML-Tags are shown as HTML-Tags

missing features:
- multiple queries
- no confirmation

known bugs:
- select of DB only works if host/user/pass are the same as for VBB
- warning on statements wich return no result (it still works, but I don't know how to fix)

Mathiau 03-27-2002 06:34 AM

and i am one of those people who has no idea, appreciated m8!

UltimaKing 03-27-2002 03:24 PM

great hack firefly *installed*

Matt 03-30-2002 01:30 PM

FANTASTIC hack! Just what I need. Thanks :D

Mathiau 04-17-2002 02:37 AM

Hello m8

Does this work in version 2.2.5

When i did a search for

PHP:
Code:

<tr><td>
<table width="100%" border="0" cellspacing="0" cellpadding="2" id="navtable">
<?php maketableheader("Options"); ?>
</table>
<a href="options.php?s=<?php echo $session[sessionhash]; ?>&action=options"> Change options </a>
</td></tr>

i could not locat e it at all in admin/ index.php
i tried various pieces from it , but could not locate any of it...?

Frankly cause i used vbhacker, and got a error that told me to run a qeury, but i can not locate phpMyAdmin or whatever u need to run a mysql query :( (amm reading up now to find the answer)

WHAT AM I MISSING!! :(

TECK 04-17-2002 07:23 AM

VB225 Update

In admin/index.php find:
Code:

makenavoption("vBulletin Options","options.php?t=0","<br>");
BELOW this, add:
Code:

makenavoption("MySQL Query","query.php?action=enter","<br>");
Make sure you download the latest hack, located here.

Mathiau 04-17-2002 07:44 AM

wicked, thnx m8!!!!!!!!

TECK 04-17-2002 07:57 AM

you are more then welcome. ;)

bandersen 04-21-2002 02:26 PM

Thank you for this hack!
Installed it with no problem... on 2.2.5

pHAZE_1 04-21-2002 10:47 PM

Quote:

<tr><td>
<table width="100%" border="0" cellspacing="0" cellpadding="2" id="navtable">
<?php maketableheader("Options"); ?>
</table>
<a href="options.php?s=<?php echo $session[sessionhash]; ?>&action=options"> Change options </a>
</td></tr>
i dont have anything like that in my index.php in my admin folder.

TECK 04-21-2002 10:50 PM

did you read the update i published 5 posts above? is alot easier to read first the thread to make sure there are no updates published.
https://vborg.vbsupport.ru/showthrea...576#post241576


All times are GMT. The time now is 02:46 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01267 seconds
  • Memory Usage 1,817KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_code_printable
  • (2)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete