[RELEASE v2] Run a SQL query directly from your admin contorl panel

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Chen
    Senior Member
    • Jun 2001
    • 8388

    [RELEASE v2] Run a SQL query directly from your admin contorl panel

    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.

    2.

    3.

    4.



    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.
    Chen Avinadav
    Better to remain silent and be thought a fool than to speak out and remove all doubt.

    גם אני מאוכזב מסיקור תחרות לתור מוטור של NRG הרשת ע"י מעריב
  • joecrow
    New Member
    • Aug 2001
    • 25

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

    Comment

    • Bane
      Senior Member
      • Jul 2000
      • 515

      #3
      Great Idea FireFly! Off to install this one Great thinking.

      Comment

      • orca
        Senior Member
        • Mar 2001
        • 1151
        • 5.5.x

        #4
        Agree with Bane

        /me is off installing...
        Ueli

        Comment

        • orca
          Senior Member
          • Mar 2001
          • 1151
          • 5.5.x

          #5
          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.
          Ueli

          Comment

          • Chen
            Senior Member
            • Jun 2001
            • 8388

            #6
            Thanks all for the comments.

            Originally posted by FireFly
            Of course running select queries with this is not very useful, but I'm working on changing that.
            Orca, I'll see what I can do.
            (btw, are you a female or a male? I've been wondering for days now )
            Chen Avinadav
            Better to remain silent and be thought a fool than to speak out and remove all doubt.

            גם אני מאוכזב מסיקור תחרות לתור מוטור של NRG הרשת ע"י מעריב

            Comment

            • Thomas P
              Senior Member
              • Apr 2001
              • 1497
              • 5.6.4

              #7
              As far as I know he's male (right?)
              Great hack btw
              -Tom
              www.MCSEboard.de
              German Windows Server & IT Pro Community dedicated to Windows Client & Server Systems. MVPs inside

              Comment

              • George L
                Former vBulletin Support
                • May 2000
                • 32996
                • 3.8.x

                #8
                interesting hack..
                :: Always Back Up Forum Database + Attachments BEFORE upgrading !
                :: Nginx SPDY SSL - World Flags Demo [video results]
                :: vBulletin hacked forums: Clean Up Guide for VPS/Dedicated hosting users [ vbulletin.com blog summary ]

                Comment

                • butty
                  Senior Member
                  • Jun 2001
                  • 221

                  #9
                  great hack, so easy 2 install even me gran could have installed it!!
                  http://

                  Comment

                  • Chen
                    Senior Member
                    • Jun 2001
                    • 8388

                    #10
                    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!
                    Last edited by Chen; Fri 24 Aug '01, 1:24pm.
                    Chen Avinadav
                    Better to remain silent and be thought a fool than to speak out and remove all doubt.

                    גם אני מאוכזב מסיקור תחרות לתור מוטור של NRG הרשת ע"י מעריב

                    Comment

                    • Wayne Luke
                      vBulletin Technical Support Lead
                      • Aug 2000
                      • 74171

                      #11
                      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.
                      Translations provided by Google.

                      Wayne Luke
                      The Rabid Badger - a vBulletin Cloud demonstration site.
                      vBulletin 5 API

                      Comment

                      • Chen
                        Senior Member
                        • Jun 2001
                        • 8388

                        #12
                        So you're saying I wasted a day of my life?
                        Thanks Wayne.
                        Chen Avinadav
                        Better to remain silent and be thought a fool than to speak out and remove all doubt.

                        גם אני מאוכזב מסיקור תחרות לתור מוטור של NRG הרשת ע"י מעריב

                        Comment

                        • orca
                          Senior Member
                          • Mar 2001
                          • 1151
                          • 5.5.x

                          #13
                          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 )
                          Just checked: Still all male.
                          Ueli

                          Comment

                          • Pie'oh'pah
                            Senior Member
                            • Jul 2001
                            • 157

                            #14
                            Thumbs up dude

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

                            Thnx

                            -Alex
                            I want to express my deepest compassion to all who have lost their loved ones in the latest terroristic attack

                            >> Nuke Bin Laden yourself here <<

                            Webmaster NÐE | Webmaster UA Forums | ArtworX ECL | Admin DiGL | Hosted at RWH | Portfolio

                            My Stylez
                            Red Darkness | Velvet Night | Dreadful Cyan
                            Goodiez
                            Table bgcolor change on hover | Onlinestatus modifications | German Templates

                                                           \\\ ///
                                                            (ô ô)
                            -------------------ooO-(_)-Ooo-----------------

                            Comment

                            • express
                              Senior Member
                              • Apr 2001
                              • 1470
                              • 3.6.x

                              #15
                              Thanks For the hack Firefly, This will make things alot easier.
                              Real Web Host

                              Comment

                              widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                              Working...