PHP works, mysql works, but when I call mysql_connect, nothing happens. What can I do?
1 Answer
I'm guessing you need to enable error reporting in your php.ini file. Or you can set this just within your script by adding these two lines:
error_reporting(E_ALL);
ini_set("display_errors", 1);
That way you can see some error messages, and go from there.
-
1Not necessarily. Let's see what the specific error is first. Jun 15, 2010 at 1:58
-
I now have a script that reads <?php error_reporting(E_ALL); ini_set("display_errors", 1); $mysqli = new mysqli('localhost', 'root', 'password', 'website'); if(mysqli_connect_errno()){ echo mysqli_connect_error(); exit(); } ?> But still no error message– lowerkeyJun 15, 2010 at 8:16
-
Scratch that, now, after a long time i get several warnings and one fatal error message: Fatal error: Maximum execution time of 30 seconds exceeded in C:\home\www\index.php on line 5– lowerkeyJun 15, 2010 at 8:17
-
I reinstalled mysql this time with version 5.5 instead of 5.1. Thanks for the tip with the error reporting!– lowerkeyJun 15, 2010 at 9:10
mysql_error()
?