Forum Moderators: coopster

Message Too Old, No Replies

PHP mysql problem

         

andrewsmd

4:58 pm on Feb 5, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I cannot get the mysql stuff to work in php. I have never used the php mysql functions, I have always used DB.php for PEAR but I can't get that installed. Anyways, here is my code

mysql_connect("localhost", "user", "password") or die(mysql_error());
mysql_select_db("database") or die(mysql_error());\

both of those return true here is my query.
mysql_query("SELECT * FROM Passwords");
Now that returns false, but if I paste that into a mysql command prompt it works fine. Any ideas why? Thanks,

eelixduppy

5:34 pm on Feb 5, 2009 (gmt 0)



It will return false is there is an error with the query or you don't have the permissions to grab that data from the table. Make sure your username and password are correct (and have permissions), and that there are no errors.