Run php in cli mode, including the following code: {code ...} run the script in putty and run cli to print only the first line of code. after connecting to mysql, the script will not be printed. Why? Solved: The mysql module is not loaded successfully in multiple environments.
Run php in cli mode, including the following code:
Echo "start"; $ connection = mysql_connect ("localhost", "root", "123456"); mysql_select_db ("mydb"); mysql_query ("set names utf8 "); echo "the database is connected ";
Run the script in putty using cli.
Only the first line of code is printed, and the printing after mysql is connected will not be executed.
Why?
Solved: The mysql module is not loaded successfully in multiple environments.
Reply content:
Run php in cli mode, including the following code:
Echo "start"; $ connection = mysql_connect ("localhost", "root", "123456"); mysql_select_db ("mydb"); mysql_query ("set names utf8 "); echo "the database is connected ";
Run the script in putty using cli.
Only the first line of code is printed, and the printing after mysql is connected will not be executed.
Why?
Solved: The mysql module is not loaded successfully in multiple environments.
Paste a phpinfo output to see it? Is your Linux system Debian?
Use pdo