I've just migrated from IIS on Windows 2000 server running PHP to Redhat Linux 7.3 with Apache 2.0.36 and PHP 4.2.1.
When I moved my site files over to the Linux box all my database code stopped working.
Here's a sample:
mysql_connect("localhost","webuser","esmwu");
mysql_select_db("ESM");
$query = "select count(*) from events where alert='1' and eventact='1'";
$result = mysql_query($query);
if (!$result) {
echo mysql_error();
exit;
}
The error I get returned is 'No Database Selected'. I have mysql installed from the rpm in the default directories /usr/bin for the executables and /var/lib/mysql for the actual data.
I've looked through the php.ini and I don't see anything to tell PHP where the MYSQL databases are stored.
What am I missing?