[BETA] CC SQL Admin - database interface - v.0.0.3

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
User avatar
Darlantan
Registered User
Posts: 369
Joined: Wed Mar 13, 2002 1:37 pm

[BETA] CC SQL Admin - database interface - v.0.0.3

Post by Darlantan » Tue Mar 04, 2003 12:18 pm

This is a simple database interface for your ACP, best described as a web-based command-line database interface.
Features:
- simple textbox/web interface for executing SQL queries
- Supported statements: ALTER, UPDATE, INSERT, CREATE, DESCRIBE, SHOW and SELECT
- Supported but must be "activated" in the code: LOAD, DELETE, DROP
- Supports multiple queries (0.0.3)
- Often used queries :can: be added to a dropdown box (in the code) (0.0.3)
- :Can: be limited to selected admins only by uncommenting and adding IDs in a code-section
- Should work with: Any phpbb supported database (I hope!)
- Tested and works on: phpBB2.0.13 mysql
- No files to edit!

Download version 0.0.3
Last edited by Darlantan on Thu Mar 10, 2005 9:09 am, edited 2 times in total.

Hunkah
Registered User
Posts: 57
Joined: Sat Mar 08, 2003 8:55 pm

Post by Hunkah » Mon Mar 17, 2003 1:37 pm

This is a great idea!!! Love this idea!!! Only it doesn't work for me.
I think the development of this is really needed for people like me that don't have access to myphpadmin. I can't access the root user of my SQL server. I am only allowed to use an installer to upload information. But once installed that is it. I lose control of what ever happens.
Could someone continue this? I have tried to go to the codecrush site and it has been down for the last couple days.

Hunkah
Registered User
Posts: 57
Joined: Sat Mar 08, 2003 8:55 pm

Post by Hunkah » Mon Mar 17, 2003 1:57 pm

Wait, if anyone is going to request database manager, I just found it.
http://www.phpbb.com/phpBB/viewtopic.php?t=20285

User avatar
Darlantan
Registered User
Posts: 369
Joined: Wed Mar 13, 2002 1:37 pm

Post by Darlantan » Tue Mar 18, 2003 10:29 am

My site is currently down as I'm upgrading some hardware and software.
Should be up soon, hopefully some time today :)

Hunkah
Registered User
Posts: 57
Joined: Sat Mar 08, 2003 8:55 pm

Post by Hunkah » Tue Mar 18, 2003 12:58 pm

There are three programs all going under different names all with the same theme. Maybe you all can get together and build the fattest mod (aka killer mod) going! One that interfaces better than phpMyAdmin! I know that each of you has something in your mod that would benifit the other giving us all the benifits too. Let me start by introducing you all... I have posted this in each of your threads. I will be the first to say I love you, and want to be friends. Now it is your turn... play nice!


Darlantan - CC SQL Admin - database interface
DanielT - Run MYSQl Queries from admin panel
Hacker~ - Database Manager

User avatar
Darlantan
Registered User
Posts: 369
Joined: Wed Mar 13, 2002 1:37 pm

Post by Darlantan » Tue Mar 18, 2003 2:50 pm

hehe.. that's a good idea Hunkah ;)
I think I already asked Hacker if he wanted to join efforts or something.
I have been busy with my server lately so I haven't kept up on this forum.

My site should be back now :)

Hunkah
Registered User
Posts: 57
Joined: Sat Mar 08, 2003 8:55 pm

Post by Hunkah » Sat Mar 22, 2003 12:02 pm

Hello... Your DB editor seems to be the only one that works right! I tried them all. But yours won't let me drop tables!
I get this:

Code: Select all

Result: DELETE and DROP queries are not turned on in the code due to their possible implications
But that is exactly what I want to do! I was wondering if you could help.
I think it is an awesome idea too you and the others getting together to work on this! Hacker~ does a great job with the username password stuff, yours on the other hand, gives full error messages! So it works, just not the way I want it to.

I was wondering if there was a command to view all the tables that exist? I have been trying to empty all my tables, I know that I have about three diffeerent table types (phpbb_ phpbb2_ phpbbplus_) I want to get rid of them all.
So anyway great work, I hope you and Hacker~ can work together. Talk to you soon.
Last edited by Hunkah on Sun Apr 06, 2003 12:35 am, edited 2 times in total.

Hunkah
Registered User
Posts: 57
Joined: Sat Mar 08, 2003 8:55 pm

Post by Hunkah » Sat Mar 22, 2003 12:18 pm

Sorry I found it... SHOW TABLES < so simple! Here I thought it was going to be complex!


But I still need help with the other stuff. SO, if you could...
Help me Obi-Wan you are my only hope! <Star Wars Quote!

User avatar
Darlantan
Registered User
Posts: 369
Joined: Wed Mar 13, 2002 1:37 pm

Post by Darlantan » Mon Mar 24, 2003 7:59 am

lol.. ok :) The reason Drop and Delete doesn't work is because it's quite
powerfull commands and could really screw up your whole db ;)
It says they are "not turned on in the code" which is almost exactly what
it means.
Open: admin_cc_db.php
Find:

Code: Select all

case "drop":
			//$result = $db->sql_query($query); //we don't support DELETE or DROP by default
			$myStatus = "DELETE and DROP queries are not turned on in the code due to their possible implications<br />";
			$rowsModified = 0;
			$output .= sprintf("<b><font color=\"%s\">%s modified</font></b><p></p>\n", $affColor, $rowsModified);
			break;
See the //$result... uncomment this and Drop queries should work ;)
You might wanna modify the next couple lines to, maybe like this:

Code: Select all

case "drop":
$result = $db->sql_query($query);
if ($result != 0) {
				$myStatus = "Supported command - OK";
				$output .= sprintf("<b><font color=\"%s\">Table or DB DROPPED!!</font></b><p></p>\n", $affColor);
			}else{
				$sql_error = $db->sql_error();
				if ( $sql_error['message'] != '' )
				{
					$outerror .= 'SQL Error : ' . $sql_error['code'] . ' ' . $sql_error['message'] . '<br />';
				}
				$myStatus = $outerror;
			}
			break;
I haven't tried that. Not sure if the result is <> 0 when you Drop something. You wanna give it a try and let me know how it goes? ;)

Hunkah
Registered User
Posts: 57
Joined: Sat Mar 08, 2003 8:55 pm

Post by Hunkah » Mon Mar 24, 2003 10:04 pm

This is what I get:


SQL Error : 1064 You have an error in your SQL syntax near '' at line 2
Query: DROP TABLE `phpbbplus_album`,
Result: SQL Error : 1064 You have an error in your SQL syntax near '' at line 2

Rows:

**By the way... is it possible to add the ability to execute more than one query at one time? For example:
DROP TABLE `phpbbplus_album`, `phpbbplus_album_cat `, `phpbbplus_album_comment `, `phpbbplus_album_config `, `phpbbplus_album_rate`;
Because this is a huge pain when trying to do more than one thing at a time.

This is the best mod going!!! You are so awesome, Im not kidding, this has made my life so much easier. I used to have to bug my server admin to work on the tables, this is not easy because he is really busy and getting him to do it takes too long! I can now do it myself.
If you want to continue developing it, I will help you any way I can... (mostly just giving ideas and testing it, cause I don't know php yet!)
Thanks again for all your help.

Hunkah
Registered User
Posts: 57
Joined: Sat Mar 08, 2003 8:55 pm

Post by Hunkah » Mon Mar 24, 2003 10:25 pm

DROP TABLE phpbbplus_album

Query: DROP TABLE phpbbplus_album
Result: Supported command - OK
Rows: Table or DB DROPPED!!

Sorry, this command works! Only I tried to do it with phpMyAdmin command syntax before, and it didn't work.

So to do more than one query at a time you need to seperate each query with a comma then add one space between them:

DROP TABLE phpbbplus_album, phpbbplus_words, phpbbplus_themes_name
Last edited by Hunkah on Tue Mar 25, 2003 12:07 am, edited 1 time in total.

Hunkah
Registered User
Posts: 57
Joined: Sat Mar 08, 2003 8:55 pm

Post by Hunkah » Mon Mar 24, 2003 11:03 pm

This is a cosmetic change for the admin_cc_db.tpl

Just replace the <table>***</table> contents with this:

Code: Select all

<table cellpadding="5" border="1" align="center" class="forumline" width="100%">
<tr><td colspan="2"><span class="gensmall">{L_MYDB_USAGE}</span><br /></td></tr>	
<tr><td colspan="2"><form method="post" name="myQueryForm" action="{S_MYDB_ACTION}"><textarea name="query" cols="90" rows="10" align=left>{S_MYDB_QUERY}</textarea></td></tr>
<tr><td align="middle"><input type="submit" name="submit" value="Execute"></form><br /><span class="gensmall">SQL Resources: <a href="http://www.mysql.com/documentation/" target="_mysql">MySQL</a></span></td></tr>
</table>
This cosmetic change is for those with 17" screens

User avatar
Darlantan
Registered User
Posts: 369
Joined: Wed Mar 13, 2002 1:37 pm

Post by Darlantan » Tue Mar 25, 2003 7:22 am

thanx for trying it out :)
I'll consider the cosmetic changes you made. My monitor at work is 19''
so I don't really know what it looks like on a 17'' hehe.

As for development, I will maintain this mod, but I can't guarantee any
swift improvements etc. I got a few to many projects going, and I kinda
suck at scheduling lol. But I read every idea and suggestion, and
sometimes I get an urge to implement some of it ;)

Regarding doing multiple queries. I've thought about it.
The "DROP tbl1, tbl2" will work cause that's how MySQL DROP command
works. But say you wanna execute 2 CREATE statements by pasting them
into the textarea:
CREATE TABLE test_table1;
CREATE TABLE test_table2;

this is not supported in this mod. The mod will probably execute the first
one and then stop. I might implement a loop for stuff like this, but prob
not in the near future. The idea is spinning in my head though so who
knows. I might get some vision on how to implement it hehe :)

Another (much simpler) thing I was considering is making some simple
tutorial. Show some examples of basic usage etc. I'm eager to know if
this mod works with other db's than mysql though, as I don't have anything
to test on right now.

All feedback is most welcome :)

User avatar
Darlantan
Registered User
Posts: 369
Joined: Wed Mar 13, 2002 1:37 pm

Post by Darlantan » Thu Mar 27, 2003 7:45 am

Moving reply to this thread:
Hunkah wrote: Well that and this:

Code: Select all

DROP TABLE `phpbb204_auth_access`, `phpbb204_banlist`, `phpbb204_categories`, `phpbb204_config`, `phpbb204_disallow`;
This is the way phpMyAdmin does their queries... what I am asking is if it is possible to allow these commands to work also. It saves tons of time rather than making this:

Code: Select all

DROP TABLE phpbb204_auth_access, phpbb204_banlist, phpbb204_categories, phpbb204_config, phpbb204_disallow;
I know it is a small little thing but anytime there is manual corrections... there is an increase in syntax errors! Allowing for the extra ` will cut all possble errors when submitting queries. Also if you add that looping option, this will allow us to cut and paste mod queries as well, with no syntax corrections or 6000 cut and pastes for only one mod.
Like I said before, this is a great (NEEDED) mod, I think there sould be awards to the best mods and most "can't live without" mods. This is definitely one of them.


The reason why DROP TABLE 'table1', 'table2'; does not work is probably
because that's incorrect syntax for MySQL. Allthough phpMyAdmin supports
it, I'm not sure supporting erronous syntax is what I want. It would be like
Internet Explorer. When my mod gets big and incorporated in systems
world wide, putting phpMyAdmin in the shade, people would think that
DROP TABLE 'table1', 'table2'.. is the correct way. So they'd start writing
all their SQL that way. Next thing you know, some new and better SQL
Admin proggie comes along, which only supports correct syntax. Then all
your old SQL queries using the '' won't work..

hehe..

I'm not junking the idea. Just debating it ;)

Good point about the loop.. it could ease mod installation.

Hunkah
Registered User
Posts: 57
Joined: Sat Mar 08, 2003 8:55 pm

Post by Hunkah » Fri Mar 28, 2003 2:02 am

No problem if you don't add the allowance for the ` ... I am only shooting out ideas. Accually it is phpMyAdmin that should change!!! I only requested it because I don't know how to query on my own, I use phpMyAdmin to make the query then I cut the query from phpMyAdmin and paste it to CC SQL Admin, thus allowing me to make a full query without typing a single letter! (saves time and syntax errors!) I still think you are awsome though!

Post Reply

Return to “[2.0.x] MODs in Development”

Who is online

Users browsing this forum: No registered users and 13 guests