I am using PHP 5.2 / Apache 2.4 / MySQL 5.0, and using the book Beginning PHP5, Apache, MySQL Web Development by wrox. I am working on configuring php with mysql but one issue I'm having with MySQL is that many of my commands will return the Error 1046: No database selected.
Here is an example of code
C:\>mysql -u root -p
Enter password: ********
Welcome to the MySQL monitor..
..
..
mysql>show tables;
ERROR 1046 (3D000): No database selected
mysql>SELECT user, host FROM user;
ERROR 1046 (3D000): No database selected
mysql>show databases;
*---------*
Database
----------
information_schema
mysql
test
--------
3 rows...
------------
As you can see I've got mysql installed and everything, and PHP works with mysql, but I don't know where this error message is coming from. What can I do to fix this? Keep in mind that I don't have an extensive background with setting up networks. Thanks