Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 04-18-2009, 05:13 AM
93Corvette 93Corvette is offline
 
Join Date: Jan 2009
Posts: 199
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Execute SQL queries - Is there a demo on what it can do?

Is there a manual, cheat sheet, or training manual that shows you different things you can do with Execute SQL Queries? I'm such a noob, that I want to just try a couple different command that I know people have done just to see the results.

I have already enable the SQL in the confib.php file.

----------------------------
I have added this in case someone else search for information like I am....

To execute SQL queries from the ACP you need to add a number ?1? to the config.php and the config.php.new (I don't know the different between them)?
This is located at: /public_html/includes
Under Config.php and config.php.new

You should see this:
// ****** USERS WITH QUERY RUNNING PERMISSIONS ******
// The users specified here will be allowed to run queries from the control panel.
// See the above entries for more information on the format.
// Please note that the ability to run queries is quite powerful. You may wish
// to remove all user IDs from this list for security reasons.
$config['SpecialUsers']['canrunqueries'] = ''; (NOTE THAT IS TWO SINGLE ')

Just add your userid to the canrunquesties. You can find your userid by going to your member list and search for your name. Here is an example:
http://www.myforum.com/member.php?u=1
The 1 after the u is your userid. In this case 1

So you would put a 1 between the ''
'SpecialUsers']['canrunqueries'] = '1';

That's it....
Reply With Quote
  #2  
Old 04-18-2009, 01:34 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't understand what you want. You can run any sql query there - there is no list of which you may run. There are some predefined ones in the dropdown though.
Reply With Quote
  #3  
Old 04-19-2009, 07:58 PM
93Corvette 93Corvette is offline
 
Join Date: Jan 2009
Posts: 199
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Lynne,
I'm a dork as far as how to do thinks like running SQL. What I was wondering is where you can find different querries that you can run in a SQL vbulletin query.

Example:
Suppose I told you to go replace the right oxygen sensor on my 93 Corvette. Could you? No, because you have never been taught how to do it. Now if you had a book that showed the steps to find the oxygen sensor, and what was needed, then you could probably do it, or, if I showed you once then you would be able to do it.....

So is there any books (written with vbullentin in mind), that will say "Type "ls -ltr" in the block to list the directory, in the long view style, and make it in date/time order. (That is actually a UNIX command). Just samples of things you can do to understand what you're doing with SQL (from the vbulletin point of view).
Reply With Quote
  #4  
Old 04-19-2009, 08:18 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I believe there actually is some book written with vbulletin in mind, but I can't recall what it's called and I have no idea what is in it. You can search amazon.com for it. Other than that, I know there are some queries posted in a few threads over in the vb.com Tips forum to do some common things, but otherwise you just need to take a look at the database, see the fields you want to select, then read up on how to write a mysql query to pull those fields for yourself.

And yes, you are right, I would have no idea how to replace the oxygen sensor on a 93 corvette. Now, an 86 corvette would perhaps be a different story.....
Reply With Quote
  #5  
Old 04-19-2009, 08:45 PM
93Corvette 93Corvette is offline
 
Join Date: Jan 2009
Posts: 199
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post

And yes, you are right, I would have no idea how to replace the oxygen sensor on a 93 corvette. Now, an 86 corvette would perhaps be a different story.....
Woo-hoo, a Corvette lady.... That is Great!

Thanks Lynne... I'm a person that like to try the basic and understand then before I screw up my forum. Thanks for the response, and motor on!....
Reply With Quote
  #6  
Old 04-19-2009, 09:03 PM
EnIgMa1234 EnIgMa1234 is offline
 
Join Date: Mar 2006
Location: .:: Ireland ::.
Posts: 1,306
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by 93Corvette View Post
Woo-hoo, a Corvette lady.... That is Great!

Thanks Lynne... I'm a person that like to try the basic and understand then before I screw up my forum. Thanks for the response, and motor on!....
You can run any kind of query through vbulletin. Go to w3schools.com for a basic lesson in SQL.

Some examples you could run include:

[SQL]SELECT * FROM thread WHERE threadid = '5'[/SQL]
This will select everything from the thread table, where threadid = 5

[SQL]SELECT username FROM user WHERE userid = '1'[/SQL]
This will select the username of a user where his/her's userid = 1

[SQL] UPDATE user SET email = 'fakeemail@fake.com' WHERE userid = '5'[/SQL]
This will set a users email address to fakeemail@fake.com where their userid = 5
Reply With Quote
  #7  
Old 04-19-2009, 09:09 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by 93Corvette View Post
Woo-hoo, a Corvette lady.... That is Great!

Thanks Lynne... I'm a person that like to try the basic and understand then before I screw up my forum. Thanks for the response, and motor on!....
Well, the vette got replaced. I'm driving an M3 now. (But, I've got some great memories of her!)

Be careful testing out any new found mysql skills. If you make a query that will give back too many results, or that is too 'complicated', or where you get stuck in an endless loop, etc., you could lock up your table and cause site problems. (Been there, done that!)
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:45 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05227 seconds
  • Memory Usage 2,227KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete