It has the form of PHP / MySQL with a drop-down list containing a list of 350 names. When a random name is selected, sometimes it works and displays information about that name from the database, and sometimes the form gives the error "No database selected."
Here is what I tried, quite clutching at a straw, as I am not a programmer:
- Increase max_connections in /etc/my.cnf from 200 to 2000 (even if only 4-5 connections are made and this is a slightly used server)
- Changing mysql_pconnect to mysql_connect
Adding the word true to this connection string:
$ mysql = mysql_pconnect ($ hostname_mysql, $ username_mysql, $ password_mysql, true) or trigger_error (mysql_error (), E_USER_ERROR);
Change the required word require_once in this line:
[? php require ('/home/user/Connections/mysql.php') ;?]
Including MySQL and PHP queries and error logging. (errors are not logged)
Here is the code: [old bad code removed]
Update: A working answer from Rob Apodaki is below.
source
share