Welcome to WebmasterWorld Guest from 54.167.83.224

Forum Moderators: brotherhood of lan & mack

Message Too Old, No Replies

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

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

Junior Member

10+ Year Member

joined:Feb 1, 2005
posts:48
votes: 0


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>';
}

?>

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

Preferred Member

10+ Year Member

joined:Feb 13, 2003
posts:590
votes: 0


This part:

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

is missing the closing curly brace.

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

Junior Member

10+ Year Member

joined:Feb 1, 2005
posts:48
votes: 0


Hi sonjay

Yu were spot on... thks...

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members