Guest Posted November 30, 2002 Posted November 30, 2002 Hi, I am getting a parse error in this line on the Latest news contribution. Can anyone point me in the right direction. $latest_news_query = tep_db_query(SELECT * from ' . TABLE_LATEST_NEWS . ' WHERE status = 1 ' . ORDER BY date_added DESC LIMIT ' . MAX_DISPLAY_LATEST_NEWS); Ta
Ajeh Posted November 30, 2002 Posted November 30, 2002 Looks like missing quote(s) mark. Do you have your original select code that we could look at?
Guest Posted November 30, 2002 Posted November 30, 2002 this is the full code on the catalog/modules as sent in the contribution... Is this what you need.. on screen it shows Parse error: parse error in /www.yourdomain.com/catalog/includes/modules/latest_news.php on line 16 <!-- latest_news //--> <?php $latest_news_query = tep_db_query(SELECT * from ' . TABLE_LATEST_NEWS . ' WHERE status = 1 ' . ORDER BY date_added DESC LIMIT ' . MAX_DISPLAY_LATEST_NEWS); if (!tep_db_num_rows($latest_news_query)) { // there is no news echo '<!-- ' . TEXT_NO_LATEST_NEWS . ' -->'; } else { $info_box_contents = array(); $info_box_contents[] = array('align' => 'left', 'text' => TABLE_HEADING_LATEST_NEWS); new contentBoxHeading($info_box_contents); $info_box_contents = array(); $row = 0; while ($latest_news = tep_db_fetch_array($latest_news_query)) { $info_box_contents[$row] = array('align' => 'left', 'params' => 'class="smallText" valign="top"', 'text' => '<b>' . $latest_news['headline'] . '</b> - <i>' . tep_date_long($latest_news['date_added']) . '</i><br>' . nl2br($latest_news['content']) . '<br>'); $row++; } new contentBox($info_box_contents); } ?> <!-- latest_news_eof //-->
mattice Posted November 30, 2002 Posted November 30, 2002 'text' => '<b>' . $latest_news['headline'] . '</b> - <i>' . tep_date_long($latest_news['date_added']) . '</i><br>' . nl2br($latest_news['content']) . '<br>'); should be a single line "Politics is the art of preventing people from taking part in affairs which properly concern them"
Ajeh Posted November 30, 2002 Posted November 30, 2002 I believe you are missing the starting quote mark: $latest_news_query = tep_db_query(SELECT * from ' . TABLE_LATEST_NEWS . ' WHERE status = 1 ' . ORDER BY date_added DESC LIMIT ' . MAX_DISPLAY_LATEST_NEWS); Try this one: $latest_news_query = tep_db_query('SELECT * from ' . TABLE_LATEST_NEWS . ' WHERE status = 1 ' . ORDER BY date_added DESC LIMIT ' . MAX_DISPLAY_LATEST_NEWS);
Guest Posted November 30, 2002 Posted November 30, 2002 tried both these and still showing parse error...
mattice Posted November 30, 2002 Posted November 30, 2002 well as soon as you are using tep_db_query() you will get a [TEP STOP] error if the query is incorrect. Check if there are other lines that are not on a single line...like 'params' => 'class="smallText" valign="top"', "Politics is the art of preventing people from taking part in affairs which properly concern them"
ottens Posted December 1, 2003 Posted December 1, 2003 same error here: Welcome Guest! Would you like to log yourself in? Or would you prefer to create an account? 1064 - You have an error in your SQL syntax near 'MAX_DISPLAY_LATEST_NEWS' at line 1 SELECT * from latest_news WHERE status = 1 ORDER BY date_added DESC LIMIT MAX_DISPLAY_LATEST_NEWS [TEP STOP] Should be something in this string: $latest_news_query = tep_db_query('SELECT * from ' . TABLE_LATEST_NEWS . ' WHERE status = 1 ORDER BY date_added DESC LIMIT ' . MAX_DISPLAY_LATEST_NEWS); the contribution: http://www.oscommerce.com/community/contributions,1451 too shame it is brokn, anyone can help us out?
soleil Posted December 25, 2003 Posted December 25, 2003 Using PHPMyAdmin check if you have included in your 'configuration' table this value of 'MAX_DISPLAY_LATEST_NEWS' . The program may be looking for it as a configuration key and it is missing.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.