Alright, I'm probably missing something pretty obvious, but I'm teaching myself PHP and MySQL, and the book I am using uses MySQLi. I was using my hosting to do my PHP testing, but it seems they don't allow MySQLi, and I don't have access to the php.ini file, so I can't enable it. So I installed PHP, MySQL, and Apache on my computer(probably all a little bit old, this book is from 2006, and I just used the CD it came with).
Anyways, I edited the php.ini file, and these are the steps I took to try to enable MySQLi.
- Edited "extension_dir" to say 'extension_dir = "C:\php\ext"'
- Added "extension=php_mysqli.dll" to the dynamic extensions section
- Changed "mysqli.default_user = "to "mysqli.default_user = root"
- Changed "mysqli.default_host = "to "mysqli.default_host = localhost"
I'm not getting any errors, but I made a simple connect script, and my pages are coming out blank, they aren't even displaying the error.
I'm sure I'm missing something really simple, but I've searched around and can't find an answer. So any help is appreciated.
Thanks.
Anyways, I edited the php.ini file, and these are the steps I took to try to enable MySQLi.
- Edited "extension_dir" to say 'extension_dir = "C:\php\ext"'
- Added "extension=php_mysqli.dll" to the dynamic extensions section
- Changed "mysqli.default_user = "to "mysqli.default_user = root"
- Changed "mysqli.default_host = "to "mysqli.default_host = localhost"
I'm not getting any errors, but I made a simple connect script, and my pages are coming out blank, they aren't even displaying the error.
Code:
<?php
$mysqli = new mysqli("localhost", "root", "****", "smaugDB");
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
else {
printf("Host information: %s\n, mysqli_get_host_info($mysqli));
}
?>
I'm sure I'm missing something really simple, but I've searched around and can't find an answer. So any help is appreciated.
Thanks.