![]() |
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. |
Take a look at https://vborg.vbsupport.ru/showthread.php?t=83122. :)
|
I'm not trying to make a page for the vBulletin admincp. It's for something entirely different.
PHP Code:
PHP Code:
|
This is the simplest way,
PHP Code:
|
That's for vBulletin. ._. I don't want it for vBulletin. If that is for anything... then even that doesn't work.
|
mysql_query() instead of $db->query()
:p |
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. |
PHP Code:
|
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.
|
Thanks guys. Appreciate the help!
|
All times are GMT. The time now is 06:32 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|