I am encountering the same problem while working through Sams Teach Yourself PHP, MySQL and Apache 4th edition book.
mySQL 5.1.30
Apache 2.2.11
PHP 5.2.8
My code is:
<?php
$mysqli = mysqli_connect("localhost", "root", "bernedit123", "sty");
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
} else {
$sql = "SELECT * FROM testTable";
$res = mysqli_query($mysqli, $sql);
if ($res) {
while ($newArray = mysqli_fetch_array($res, MYSQLI_ASSOC)) {
$id = $newArray['id'];
$testField = $newArray['testField'];
echo "The ID is ".$id." and the text is ".$testField."<br/>";
}
} else {
printf("Could not retrieve records: %s\n", mysqli_error($mysqli));
}
mysqli_free_result($res);
mysqli_close($mysqli);
}
?>
I get the MS Windows error pop up and Internet Explorer cannot display the page:
Microsoft windows message
Apache HTTP Server stopped working and was closed
A problem caused the application to stop working correctly.
Windows will notify you if a solution is available.
I have been using Google to locate an answer.
Thanks for any feedback.