Well, I'm not a total dunce, but this is the first time I am using MySQL and phpMyAdmin so maybe I just dont get something. In fact I must not get something, because I am able to log in to MySQL, but my script "mysql_select_db" is not finding the database I set up in phpMyAdmin.
Bless you for your help oh great community! IAAR at your mercy.
Here is all the relevant data:
My Host: JV-Hosting.net
PHP ver: 4.3.4
PHPinfo: http://jv-admin.net/phpinfo.php
MySQL ver: 4.0.18-standard
My Host User Name: wjames
MySQL User: wjames@localhost
Host Software I am Using:
Cpanel X (although seperately listed as 8.7.0 ?? - not really important)
MySQL AccountMaintenance (part of Cpanel)
phpMyAdmin
Here is what the Cpanel and phpMyAdmin has to say about my databases:
MySQL User: wjames_wjames
(this is the user name I created in the MySQL AccountMaintenance tools)
(I gave it the name "wjames" and it stuck that on the end of "wjames_")
MySQL Database: wjames_headshots
(again I gave it the name "headshots" and the Cpanel stuck it on to "wjames_")
phpMyAdmin reports the same names. There are no tables in the database "wjames_headshots".
Here is my PHP code:
<?php
$user="wjames_wjames";
$password="**********";
$database="wjames_headshots";
$link = @mysql_connect(localhost,$user,$password) or die ("Unable to connect");
$db_list = mysql_list_dbs($link);
while ($row = mysql_fetch_object($db_list)) {
echo $row->Database . "\n";
}
@mysql_select_db($database) or die( "Unable to select database");
mysql_close();
?>
end php
The code returns no list of databases and the select_db function dies.
When I have switched the user name to just "wjames" it fails to connect!
I have also tried selecting the database "headshots" without the "wjames_" but that also fails.
So, I am totally stumped!
Thanks Alot!
Atomic