Re: Help with

From: Date: Fri, 02 Sep 2005 10:35:40 +0000
Subject: Re: Help with
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-40200@lists.php.net to get a copy of this message
Martin is right... carefully~ @ $db = new mysqli('localhost', 'root', 'password', 'database_table'); On 8/30/05, Richard Hart <rjhart10@btinternet.com> wrote: > > Hi > > I'm new to PHP/MySQL and wondered if anyone on this list would be kind > enough to help me solve > this problem. I'm trying to automatically set up a users privileges on a > MySQL table using the > username and password selected by them in an html form. I get the error > message: > > "Warning: mysql_query(): supplied argument is not a valid MySQL-Link > resource" > > for the code below: > > <?php > > $username=$_POST['username']; > $password=$_POST['password']; > > @ $db = new mysqli('localhost', 'root', 'password', > 'database_table'); > > if (mysqli_connect_errno()) > { > echo 'Error: Could not connect to database. Please try again later.'; > exit; > } > > $grant_privilege = "grant select, insert, delete, update on name_of_table > to > $username identified by '$password'"; > mysql_query($grant_privilege, $db); > > $db->close(); > > ?> > > Can anyone help? > > Thanks > > Richard > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- From : Fen lu

« previous php.db (#40200) next »