Lodius2000 Posted May 29, 2008 Share Posted May 29, 2008 i am getting a parse error , unexpected ')' on line 31 just look for the comment <?php session_start(); require ('../../../install/PEAR/DB.php'); require ('../../../../dbfiles/db_login.php'); require ('../formhelpers/formhelpers.php'); $db->setErrorHandling(PEAR_ERROR_DIE); $db->setFetchMode(DB_FETCHMODE_ASSOC); if ($_SESSION['username']){ $list = $db->getAll('SELECT article_id, timestamp, article_title FROM text_cms'); print "<html>\n"; print "<head>\n"; print "</head>\n"; print "<body>\n"; print "<p>Logged in as <strong>$_SESSION[username]</strong></p>\n"; print "<br />\n"; print "<br />\n"; print "<table>\n"; print "<th>\n"; print "<td><strong>Article ID</strong></td>\n"; print "<td><strong>Article Title</strong></td>\n"; print "<td><strong>Timestamp</strong></td>\n"; print "</th>\n"; //the following line is line 31 foreach ($list = $row) { print "<tr><td>$row[0]</td><td>$row[2]</td><td>$row[1]</td></tr>\n"; } print "</table>\n"; print 'There are ' . $list->numrows() . ' articles in the database.'; print "</body>\n"; print "</html>\n"; } else { print '<a href="../index.php">Log In dummy</a>'; } ?> wheres the error? Link to comment https://forums.phpfreaks.com/topic/107737-solved-quick-parse-error-thread/ Share on other sites More sharing options...
Lodius2000 Posted May 29, 2008 Author Share Posted May 29, 2008 Solution foreach requires a $var as $var2 statement, not an = guess i just needed to write the thread give my eyes a rest Link to comment https://forums.phpfreaks.com/topic/107737-solved-quick-parse-error-thread/#findComment-552301 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.