Welcome to WebmasterWorld Guest from 54.196.175.173

Forum Moderators: brotherhood of lan & mack

Message Too Old, No Replies

Why am i gettin error at the last line "?>"?

     

apollo23

3:05 pm on Jan 27, 2006 (gmt 0)

10+ Year Member



Hi guys

Am trying to learn php again and hv encountered problem which i hv listed below. Anybody know why it show error?

Thanks

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

<head>
<title>CGIG: Display your content</title>
</head>

<?php


// Display content in database

$dbcnx=@mysql_connect('localhost','root','');
if (!$dbcnx) {
exit('<p>Unable to connect to the database server at this time.</p>');
}

if (!@mysql_select_db('cgig')) {
exit('<p>Unable to locate content at this time.</p>');
}
$result=@mysql_query('SELECT filename,headline,about,keywords,content FROM content');
if (!$result) {
exit('<p>Unable to perform query.</p>');

//Display the content of site
while ($row=mysql_fetch_array($result)) {
echo '<p>'. $row['filename'].'</p>';
}

?>

sonjay

4:27 pm on Jan 27, 2006 (gmt 0)

10+ Year Member



This part:

if (!$result) {
exit('<p>Unable to perform query.</p>');

is missing the closing curly brace.

apollo23

12:54 am on Jan 28, 2006 (gmt 0)

10+ Year Member



Hi sonjay

Yu were spot on... thks...

 

Featured Threads

Hot Threads This Week

Hot Threads This Month