I have reinstalled the newer versions of XAMPP, PHP, MySQL and also Elclipse Mars and XDebug. The database is accessible by PHPMySdmin.
In PHP I connect the user to the server
$x = mysql_connect('localhost', 'user');
echo "Connect=($x)<BR>";
if (!$x) echo "Connect failed";
This connects fine when I don't use the user's password. It fails when I do.
Then I try to select the database with
$db = 'database';
$b = mysql_select_db($db, $x);
This fails. So does
$b = mysql_query("USE $db", $x);
I have granted users all permissions.
Obviously I am missing something. Do I have to associate the user to the database in phpMyAdmin? How? Something else?
My configuration.
XAMPP 3.2.2 PHP 5.5.30 Eclipse Mars (4.5.1) XDebug 2.3.3
Thank you.