Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / SQL & PHP

Author
Message
AlexI
19
Years of Service
User Offline
Joined: 31st Dec 2004
Location: UK
Posted: 23rd Nov 2006 20:20 Edited at: 23rd Nov 2006 20:21
How can i get this php/mysql code to only return databases that contain user_*

php file attached aswell

Thanks,
Alex


Attachments

Login to view attachments
adr
21
Years of Service
User Offline
Joined: 21st May 2003
Location: Job Centre
Posted: 24th Nov 2006 10:25

?


I'm superfly TNT
AlexI
19
Years of Service
User Offline
Joined: 31st Dec 2004
Location: UK
Posted: 25th Nov 2006 00:51
Thanks what SQL do i use get a database's size?


AlexI
19
Years of Service
User Offline
Joined: 31st Dec 2004
Location: UK
Posted: 25th Nov 2006 13:32 Edited at: 25th Nov 2006 13:33
Also how can i delete a user, i created via the grant method?

i tried DROP USER "user_testdb"; but it failed it only seems to be able to delete users using that made with CREATE USER "user_testdb";

Any ideas, i would really apreciate any help,
Thanks,
Alex


Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 25th Nov 2006 15:57
lookup the revoke command... Seriously, MySQL has a heap load of documentation on this kinda stuff! I have a MySQL CHM (windows help file) which I use that I got from the MySQL site and the REVOKE command it directly below the GRANT command in the documentation.

About the database size, are you referring to how much diskspace it takes up?

[center]
AlexI
19
Years of Service
User Offline
Joined: 31st Dec 2004
Location: UK
Posted: 25th Nov 2006 17:14
Yea, so like in mb. Just downloaded the chm file


adr
21
Years of Service
User Offline
Joined: 21st May 2003
Location: Job Centre
Posted: 25th Nov 2006 18:04
OK, fair enough. That's a marginally tricky question: It will take two queries rather than one.... You can't do it in one go

http://dev.mysql.com/doc/refman/5.0/en/show-tables.html
http://dev.mysql.com/doc/refman/5.0/en/show-table-status.html


I'm superfly TNT
Raven
19
Years of Service
User Offline
Joined: 23rd Mar 2005
Location: Hertfordshire, England
Posted: 25th Nov 2006 21:02
what is it with the spate of users posting in the more 'general' forum over the 'programming languages'? Shouldn't these posts be moved to the right forum?

Intel Core 2 Duo E6400, 512MB DDR2 667MHz, ATi Radeon X1900 XT 256MB PCI-E, Windows Vista Business / XP Professional SP2
AlexI
19
Years of Service
User Offline
Joined: 31st Dec 2004
Location: UK
Posted: 25th Nov 2006 21:54
So do i do

?

thanks,
Alex


Steve J
18
Years of Service
User Offline
Joined: 22nd Apr 2006
Location: Vancouver, Washington
Posted: 25th Nov 2006 22:11
I would suggest buying books.

http://phoenixophelia.com

Steve J, less, and less Controversial!
AlexI
19
Years of Service
User Offline
Joined: 31st Dec 2004
Location: UK
Posted: 26th Nov 2006 00:23 Edited at: 26th Nov 2006 00:26
Why does this delete user code not work? by the way i found it in a book


Thanks,
Alex

http://www.amazon.com/PHP-MySQL-Web-Development-Second/dp/067232525X/sr=1-2/qid=1164497151/ref=pd_bbs_sr_2/103-5791289-9338221?ie=UTF8&s=books


Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 26th Nov 2006 11:07
oh dear... rtfm!

The syntax is wrong. For starters, there shouldn't be a comma in it.

which version of MySQL?
http://dev.mysql.com/doc/refman/4.1/en/revoke.html

You need something like:


[center]
AlexI
19
Years of Service
User Offline
Joined: 31st Dec 2004
Location: UK
Posted: 26th Nov 2006 11:23
doesnt work

This how i create my user


And this how i try but doesnt work to delete it:

Quote: "MySQL said:
#1141 - There is no such grant defined for user 'alexillsley_test' on host '%' "



Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 26th Nov 2006 19:18
try FROM 'alexillsley_test'@'localhost'

[center]
AlexI
19
Years of Service
User Offline
Joined: 31st Dec 2004
Location: UK
Posted: 1st Dec 2006 01:03
That gives me a MySQL syntax error


Chris Franklin
19
Years of Service
User Offline
Joined: 2nd Aug 2005
Location: UK
Posted: 1st Dec 2006 10:26
Then your Sql Syntax is wrong not the php

AlexI
19
Years of Service
User Offline
Joined: 31st Dec 2004
Location: UK
Posted: 1st Dec 2006 11:51
Quote: "try FROM 'alexillsley_test'@'localhost'"



adr
21
Years of Service
User Offline
Joined: 21st May 2003
Location: Job Centre
Posted: 1st Dec 2006 12:08 Edited at: 1st Dec 2006 12:11
Don't get pissy because people are annoyed with you. Anyone who has contributed to the building of your server empire has every right to lose patience with you. For some reason, you absolutely refuse to RTFM on any piece of software.

Because you're a little scant on the details, we don't know if you just entered

into the MySQL client. If that's the case, then you rightly deserve a MySQL syntax error. If however you entered

and you received a mysql syntax error, something is very wrong here...

I checked my answers by typing

mysql revoke example

into google, and then hitting "I'm feeling lucky". You know what? It came up with an example on how to use the REVOKE statement on MySQL. Even better, it's in a document titled "Getting Started with MySQL".


I'm superfly TNT
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 1st Dec 2006 12:47
Quote: "It came up with an example on how to use the REVOKE statement on MySQL"

You lie... Surely such useful information cannot be found by simply searching for it?!

Alternatively, its possible my example might not need quotes...

[center]
Kentaree
22
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Clonmel, Ireland
Posted: 1st Dec 2006 12:51
Just going on a slight tangent for my own purposes, but anyone here notice Plesk sucks when it comes to MySQL management? Trying to set up something on our webserver, and the installer is complaining about lack of LOCK TABLE access. Fair enough, but WHERE IN GOD'S NAME does it allow you to either do it visually, or have an admin-permission query field?

Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 1st Dec 2006 12:55
MySQL Web Managed == phpMyAdmin

Its very simple. Everything else I've used for managing MySQL via the web has sucked in comparison.

For some reason, very few things actually provide access to the LOCK TABLE privilege! Even SQLYog doesn't seem to have it.

[center]
Kentaree
22
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Clonmel, Ireland
Posted: 1st Dec 2006 13:02
Plesk comes with phpMyAdmin, but it seems to be a castrated version, a lot of useful stuff has been stripped out for some reason

AlexI
19
Years of Service
User Offline
Joined: 31st Dec 2004
Location: UK
Posted: 1st Dec 2006 16:05
I got it working with the drop use command



Login to post a reply

Server time is: 2024-11-17 23:48:26
Your offset time is: 2024-11-17 23:48:26