Dear All,
I am trying to learn mysql on my own and I was following an example. I have everything installed apache/php/mysql on win2k and working fine. I even managed to create a database jokes thru command prompt start>programs>accessories>, and I can display very well. However tryong to display in my browser using
PHP Code:
<html>
<head>
<title>Our List of Jokes </title>
</head>
<body>
<?php
// Connect to the database server
$dbcnx = @mysql_connect('localhost', 'root', 'myne');
if (!$dbcnx) {
die( '<p>Unable to connect to the ' .
'database server at this time.</p>' );
}
// Select the jokes database
if (! @mysql_select_bd('Jokes', $dbcnx) ) {
die( '<p>Unable to locate the joke ' .
'database at this time.</p>' );
}
?>
<p> Here are all the jokes in our database: </p>
<blockquote>
<?php
// Request the text of all the jokes
$result = @mysql_querry('SELECT JokeText FROM Jokes');
if (!$result) {
die('<p>Error performing query: ' . mysql_error() .
'</P>');
}
// Display the text of each joke in a paragraph
while ( $row = mysql_fetch_array($result) ) {
echo('<p>' . $row['JokeText'] . '</p>');
}
?>
</blockquote>
</body>
</html>
won't work. What could be the problem.