coding

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kev83
Forum Newbie
Posts: 3
Joined: Mon Apr 19, 2004 2:45 pm
Location: KL, Malaysia

coding

Post 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>
Rev44
Forum Newbie
Posts: 1
Joined: Tue Apr 20, 2004 2:03 am
Location: Denver,US

Post 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
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

kev83

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

Read it VERY CAREFULLY

Thanks

Mark
Post Reply