RE: [PHP-WIN] unhappy camper

From: Date: Mon, 02 Apr 2001 09:18:39 +0000
Subject: RE: [PHP-WIN] unhappy camper
Groups: php.windows 
Request: Send a blank email to php-windows+get-6432@lists.php.net to get a copy of this message
You forgot to select a database. mysql_select_db("database",$link_id); That should work. > ---------- > From: paul morgan[SMTP:paul@sibley-morgan.freeserve.co.uk] > Sent: Saturday, March 31, 2001 1:53 AM > To: php-windows@lists.php.net > Subject: [PHP-WIN] unhappy camper > > hi, > I'm new to this game but have managed to set up apache 1.3.19 that runs > php/4.0.4pl1 (the apache dll I think) on Win 98 SE. I've also installed > the > windows build of mysql, version 3.23 I think and can administer easily via > the msdos prompt. I have removed the general root user, as in the mysql > Docs > and replaced it with my own logon user and pwd. > > The problem is that I can't seem to pull anything out of a database that I > create. I've read the docs that come with mysql, esp Ch6 and privileges, > but > even simple things like typing 'show grants;' gives me an error in the > msdos > prompt yet I can insert, delete etc data from the database I created > whilst > in the msdos prompt - command line interface. I can connect to mysql using > the 'mysql_connect() function in php I think (I don't get any erroes when > just testing the connection) but when actually going to do something via > php > I get an error similar to this; > > Warning: Supplied argument is not a valid MySQL result resource in > ...location of file then line number. > > Some example code that fails is below. It fails on the line where the > 'while' loop starts but I think that's because the $result var doesn't > seem > to be allowed to list tables?? but I don't know why. > > > <?php > > $link_id = mysql_connect("localhost", "myUsername", > "myPassword"); > > $result = mysql_query("SHOW TABLES", $link_id); > > while($query_data = mysql_fetch_row($result)) > { > echo "$query_data[0], is some data <br>"; > } > > ?> > > > Anyone got any ideas as to why I'm getting stuffed? Is it permissions > within > mysql or is there a known bug in one of the apps that is messing me about. > Any suggestions gratefully received. Please reply to this or to my addy > directly. > > Many thanks ;) > > Paul > > > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net > For additional commands, e-mail: php-windows-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.windows (#6432) next »