Re: I got a little confusion about mysql and php
| From: | Constantin Baciu | Date: | Sat, 07 Sep 2002 19:13:37 +0000 |
| Subject: | Re: I got a little confusion about mysql and php | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-15702@lists.php.net to get a copy of this message | ||
"Raheel Hussain" <raheelphp@yahoo.com> wrote in message
news:20020907121827.98224.qmail@web21205.mail.yahoo.com...
>
>
> hi,
>
> I m a newbie programmer and has just started working on php, i m not
actually having much problem in it as because i have backgroud of C/C++ and
vb and ASP and Pascal etc.
> I have a little confusion , may be it is gonna be a cheap question the
question is as follows
>
> 1 - I have a mysql database on my local server on which i m trying php
scripts.
> now i m gonna upload this site,
> I found out a function of mysql through which i m going to create the
> mysql db on the sever with phpscripts
> which is ( mysql_create_db() )
> but i want to write my scripts as follows
>
> if ( database doesn't exists )
> create db;
As far as I know, in mysql you cannot create a database that is allready
created.... So, the mysql_create_db() function *should* return an error....
>
> 2 - and the other thing which is actually about mysql, which is how do i
set different database passwords to different database.
>
> as because in my server ( win 2000 ) there is only one password which i
use when using mysql_connect() fucntion
>
>
Again, as far as I know, mysql has a user+host+password security setup. That
is, if you have an user (say foo-user) with the password foo-password, you
could give it access only to a database (based on username and password)...
Then you could create another user, with the same name but another
password... and give it access to another database.....
The GRANT syntax is : GRANT ...privileges... on database[.table.[column]]
to user foo.. identified by password...
>
> ---------------------------------
> Do You Yahoo!?
> Yahoo! Finance - Get real-time stock quotes