Fatal error when loading php page

Hi I keep getting a fatal error in Apache 2.2.14 when trying to load this page index.php - Whilst working though one of Sitrepoints tutorial books

Im new to PHP and cant seem to get around this error, please help

<?php
if (get_magic_quotes_gpc())
{
function stripslashes_deep($value)
{
$value = is_array($value) ?
array_map(‘stripslashes_deep’, $value) :
stripslashes($value);

return $value;
}

$_POST = array_map(‘stripslashes_deep’, $_POST);
$_GET = array_map(‘stripslashes_deep’, $_GET);
$_COOKIE = array_map(‘stripslashes_deep’, $_COOKIE);
$_REQUEST = array_map(‘stripslashes_deep’, $_REQUEST);
}

if (isset($_GET[‘addjoke’]))
{
include ‘form.html.php’;
exit();
}

$link = mysqli_connect(‘localhost’, ‘root’, ‘evie’);
if (!$link)
{
$error = ‘Unable to connect to the database server.’;
include ‘error.html.php’;
exit();
}

if (!mysqli_set_charset($link, ‘utf8’))
{
$output = ‘Unable to set database connection encoding.’;
include ‘output.html.php’;
exit();
}

if (!mysqli_select_db($link, ‘ijdb’))
{
$error = ‘Unable to locate the joke database.’;
include ‘error.html.php’;
exit();
}

if (isset($_POST[‘joketext’]))
{
$joketext = mysqli_real_escape_string($link, $_POST[‘joketext’]);
$sql = ‘INSERT INTO joke SET
joketext="’ . $joketext . ‘",
jokedate=CURDATE()’;
if (!mysqli_query($link, $sql))
{
$error = 'Error adding submitted joke: ’ . mysqli_error($link);
include ‘error.html.php’;
exit();
}

header(‘Location: .’);
exit();
}

if (isset($_GET[‘deletejoke’]))
{
$id = mysqli_real_escape_string($link, $_POST[‘id’]);
$sql = “DELETE FROM joke WHERE id=‘$id’”;
if (!mysqli_query($link, $sql))
{
$error = 'Error deleting joke: ’ . mysqli_error($link);
include ‘error.html.php’;
exit();
}

header(‘Location: .’);
exit();
}

$result = mysqli_query($link, ‘SELECT id, joketext FROM joke’);
if (!$result)
{
$error = 'Error fetching jokes: ’ . mysqli_error($link);
include ‘error.html.php’;
exit();
}

while ($row = mysqli_fetch_array($result))

{
$jokes = array(‘id’ => $row[‘id’], ‘text’ => $row[‘joketext’]);
}

include ‘jokes.html.php’;
?>

Error signature reads :
szAppName : httpd.exe szAppVer : 2.2.14.0 szModName : php_mysqli.dll
szModVer : 5.2.11.11 offset : 00002b5b

Please help -

Chapter 4 of the book? I think we need to keep a note of when people post about problems with that script and apache crashing we need to note what version of Apache they are using. I think a number have been using version 2.2.14 who have had problems

Hi

Dont know if it is of any use but I found a thread on mysql site forums
http://forums.mysql.com/read.php?52,257110,257626#msg-257626
which talked about copying the “libmysql.dll” file from my PHP folder to the Windows system32

Worth a go! Do a backup first though! Safety first!

If anything can go wroing…it WILL

Keith

Have you checked out the phpinfo(),
is mysqli extension is enabled?

Yep - I’m using Apache version 2.2.14

Mysqli library is enabled

Apache error log reads

“[Mon Jan 04 08:31:40 2010] [notice] Parent: child process exited with status 3221225477 – Restarting.
httpd.exe: Could not reliably determine the server’s fully qualified domain name, using 192.168.1.72 for ServerName
[Mon Jan 04 08:31:40 2010] [notice] Apache/2.2.14 (Win32) PHP/5.2.11 configured – resuming normal operations
[Mon Jan 04 08:31:40 2010] [notice] Server built: Sep 28 2009 22:41:08
[Mon Jan 04 08:31:40 2010] [notice] Parent: Created child process 3640
httpd.exe: Could not reliably determine the server’s fully qualified domain name, using 192.168.1.72 for ServerName
httpd.exe: Could not reliably determine the server’s fully qualified domain name, using 192.168.1.72 for ServerName
[Mon Jan 04 08:31:40 2010] [notice] Child 3640: Child process is running
[Mon Jan 04 08:31:40 2010] [notice] Child 3640: Acquired the start mutex.
[Mon Jan 04 08:31:40 2010] [notice] Child 3640: Starting 64 worker threads.
[Mon Jan 04 08:31:40 2010] [notice] Child 3640: Starting thread to listen on port 8080.”

If it makes any sence to any of you?

I copied “libmysql.dll” to windows 32 file and it now works - Thanks

Anyone any ideas why?

I bet it is about table definition again. And too smart mysqli extension.
Can we take a look at the jokes table structure?