I am using php to create the script for doing for creating a login program. Being new to this, I copied mysql database to the server. The database is called clamps and I have a text file customers. There are two three more files, frm, myd, and myi.
now the code
$connection = mysql_connect($host, $user, $pass) or die ("Unable to connect!");
mysql_select_db($db,$connection) or die ("Unable to select database!");
provides the message "Unable to select database!". The code before that connects to mysql and all is ok. Can any body stear me in the right direction?
It's very critical to check the MySQL logs as well as whatever your PHP program may produce.
When you "go live" with your database, consider building error logging capabilities within your database layer that post the messages to a database table, then give a generic answer to the user. In this way, you can know what's going wrong, but they, if they have nefarious intentions, will not glean clues about what your database is doing from the error-messages they receive.
Also: don't reinvent the wheel here. There are many well-developed PHP libraries and objects which are purpose-built for database access. Use them.