homepage Welcome to WebmasterWorld Guest from 54.161.175.231
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / WebmasterWorld / New To Web Development
Forum Library, Charter, Moderators: brotherhood of lan & mack

New To Web Development Forum

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




msg:970211
 3:05 pm on Jan 27, 2006 (gmt 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>';
}

?>

 

sonjay




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

This part:

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

is missing the closing curly brace.

apollo23




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

Hi sonjay

Yu were spot on... thks...

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / WebmasterWorld / New To Web Development
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved