Hello. I am in the process of learning php. I am particularly
interested in its uses with MySQL. I have Apache 2 and PHP5 both
installed and working fine. I pasted a MySQLi example for opening and
connecting to a MySQL DB into "hello.php"
<?php
$mysqli = new mysqli("localho st", "my_user", "my_passwor d", "world");
/* check connection */
if (mysqli_connect _errno()) {
printf("Connect failed: %s\n", mysqli_connect_ error());
exit();
}
printf("Host information: %s\n", $mysqli->host_info);
/* close connection */
$mysqli->close();
?>
For some reason when I get:
Fatal error: Class 'mysqli' not found in D:\Apache
group\Apache2\h tdocs\hello.php on line 7
I installed PHP in "d:\php" and added it to my path in my autoexec.bat.
in php.ini:
....
extension_dir = "d:\php\ext "
....
extension=php_m ysqli.dll
I read all the posts at the bottom of the pages on PHP.net website where
someone says "I had a problem and I got...yada...ya da and did everything
each of those posts said you had to do and it still won't work.
The only thing left is how PHP needs compiled with a "--with" statement
or something like that but I'm using the windows binary so that
shouldn't be a problem...
Is there some other problem it could be besides a problem with finding a
dll or ini?
Thanks
Bryce Byrd
interested in its uses with MySQL. I have Apache 2 and PHP5 both
installed and working fine. I pasted a MySQLi example for opening and
connecting to a MySQL DB into "hello.php"
<?php
$mysqli = new mysqli("localho st", "my_user", "my_passwor d", "world");
/* check connection */
if (mysqli_connect _errno()) {
printf("Connect failed: %s\n", mysqli_connect_ error());
exit();
}
printf("Host information: %s\n", $mysqli->host_info);
/* close connection */
$mysqli->close();
?>
For some reason when I get:
Fatal error: Class 'mysqli' not found in D:\Apache
group\Apache2\h tdocs\hello.php on line 7
I installed PHP in "d:\php" and added it to my path in my autoexec.bat.
in php.ini:
....
extension_dir = "d:\php\ext "
....
extension=php_m ysqli.dll
I read all the posts at the bottom of the pages on PHP.net website where
someone says "I had a problem and I got...yada...ya da and did everything
each of those posts said you had to do and it still won't work.
The only thing left is how PHP needs compiled with a "--with" statement
or something like that but I'm using the windows binary so that
shouldn't be a problem...
Is there some other problem it could be besides a problem with finding a
dll or ini?
Thanks
Bryce Byrd
Comment