I have a problem. I'm a newbie to php and I just started this book on building your own database driven website using PHP & Mysql. The first example that they have is creating a database and displaying them on the Browser using PHP.
My problem is that when I try to preview the example in any browser it's blank, there's nothing on the screen. I'm using IIS 5.1 for window xp with php installed. Myspl is also installed and running.
This is the php code that I have:
<?PHP
//Connect to the database server
$dbcnx = @mysql_connect('localhost', 'esantiago13', '*********');
if (!$dbcnx) {
exit('<p>Unable to locate the joke' . 'database at this time.</p>');
}
//Select the joke database
mysql_select_db('ijdb', $dbcnx);
exit('<p>Unable to locate the joke' . 'database at this time.</P>');
?>
<p>Here are all the jokes in out database:</p>
<blockquote>
<?PHP
//Request the text of all the jokes
$result = @('SELECT joketext FROM joke');
if (!$Result) {
exit('<p>Error performing query:' . mysql_error() . '</p>');
}
//Display the text of esch joke in a paragraph
while ($row = mysql_fetch_array($result)) {
echo '<p>' . $row['joketext'] . '</p>';
}
?>
</blockquote>
And when I view the Page Source of the page I see this output:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<!-- TemplateBeginEditable name="doctitle" -->
<title>Untitled Document</title>
<!-- TemplateEndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- TemplateBeginEditable name="head" -->
<!-- TemplateEndEditable -->
</head>
<body>
And that's it nothing else can any one help???