The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
PHP Back-End for SQL Query Form?
I'm building a form for an admincp that I'm making and I want to be able to run queries directly from the admincp. I want it to be similar to the way vBulletin has it, but I don't need all of the confirmations that vBulletin has.
If I just used a plain old textarea box named sqlquery, what would the php look like to make it work? For some reason... I just can't get it working. >_> Thanks. |
#2
|
||||
|
||||
Take a look at https://vborg.vbsupport.ru/showthread.php?t=83122.
|
#3
|
||||
|
||||
I'm not trying to make a page for the vBulletin admincp. It's for something entirely different.
PHP Code:
PHP Code:
|
#4
|
||||
|
||||
This is the simplest way,
PHP Code:
|
#5
|
||||
|
||||
That's for vBulletin. ._. I don't want it for vBulletin. If that is for anything... then even that doesn't work.
|
#6
|
||||
|
||||
mysql_query() instead of $db->query()
|
#7
|
||||
|
||||
That will do it though? Maybe I'm doing something wrong. Let me run over it all again... but I swear that's coming back at me with an error. ._. Uno momento!
Okay- that works for one query. What if I want to do two queries in one submission? INSERT INTO `table` (field) VALUES ('banana'); INSERT INTO `table` (field) VALUES ('banana'); Doesn't work. |
#8
|
||||
|
||||
PHP Code:
|
#9
|
||||
|
||||
Yep, may want to add some error checking to those. Another alternative to exploding by ; is to use mysqli_multi_query() which is also useful for things like stored procedures, etc.
|
#10
|
||||
|
||||
Thanks guys. Appreciate the help!
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|