Page 1 of 1

coding

Posted: Tue Apr 20, 2004 1:55 am
by kev83
I still don't know whats wrong with my coding, it turns to a blank page....i need help urgent pls reply ASAP
<html>
<head>
<title>view guestbook</title>
</head>
<body>
<table border=0>
<?php
@ $db = mysql_pconnect('localhost', 'root', '');


{
print 'Error: Could not connect to database. Please try again later.';
exit;
}

mysql_select_db('guest');
$query = "select * from guestbook";
$result = mysql_query($query);

$num_results = mysql_num_rows($result);



{
$row = mysql_fetch_array($result);
print '<p></strong> Name: ';
print htmlspecialchars(stripslashes($row['name']));
print '</strong><br />location: ';
print stripslashes($row['location']);
print '<br />Email: ';
print stripslashes($row['email']);
print '<br />URL: ';
print stripslashes($row['url']);
print '<br />Comments: ';
print stripslashes($row['comments']);
print '</p>';
}
?>
</table>
</body>
</html>

Posted: Tue Apr 20, 2004 2:03 am
by Rev44
i notice u have rogue {}
you probably missed some if and some selction functions
if add those functions you can get it working

Posted: Tue Apr 20, 2004 3:09 am
by JayBird
kev83

Please may i direct you to read this - viewtopic.php?t=21171

Read it VERY CAREFULLY

Thanks

Mark