RoninNYC Posted September 10, 2007 Share Posted September 10, 2007 I'm pretty new to php/mysql, im used to java/jsp/mssql. I'm just trying to set it up at this point. When I run a simple php script it works fine (ie: I can get the date etc.) Now I'm trying to just do a simple database connection script that should print out the list of databases. When I run it I get a completely blank screen. I have asterisked out the username/pword but I am 100% certain they are accurate. <?php $conn = mysql_connect("localhost", "***", "***"); $result = mysql_list_dbs($conn); while($db_data = mysql_fetch_row($result)){ echo "<b> $db_data[0] </b><br>"; } ?> When I go to view source, I get absolutely nothing. This tells me that the code isn't getting into the while loop (since there is html in the while loop, yet nothing is being printed out.) is this correct logic? Does anyone know whats wrong? Many thanks in advance Quote Link to comment Share on other sites More sharing options...
RoninNYC Posted September 10, 2007 Author Share Posted September 10, 2007 [Mon Sep 10 17:20:17 2007] [error] [client 127.0.0.1] PHP Fatal error: Call to undefined function mysql_connect() in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\test.php on line 3 Sorry forgot to post the error log. Quote Link to comment Share on other sites More sharing options...
d22552000 Posted September 10, 2007 Share Posted September 10, 2007 thats a big screw up on your part, not posting the error log. make your php understand that mysql exists. check it, its a sticky thread. http://www.phpfreaks.com/forums/index.php/topic,126354.0.html Quote Link to comment Share on other sites More sharing options...
Jessica Posted September 10, 2007 Share Posted September 10, 2007 You also never select a database. Quote Link to comment Share on other sites More sharing options...
RoninNYC Posted September 11, 2007 Author Share Posted September 11, 2007 You also never select a database. Thanks for the help so far. I dunno I just copied it out of a book. I think it's supposed to just print out all the databases's names. Either way, I tried doing that but my PHP folder doesn't have a subfolder call \ext It compiles php fine, but no ext folder. weird...anyone? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.