Problem: A syntax error occurs when creating a page where the link is not shown in the menu. It's an MySQL syntax error so it should be here somewhere.
Error: Error In Execution
MYSQL Said: DB Error: syntax error
<tr>
<td align="right">
<input type="checkbox" name="view" value="1" {if 1 eq $smarty.request.view|default:$cat.view}checked="checked"{/if} />
</td>
<td align="left">
Link tonen in het menu
</td>
</tr>
SQL
Code:
CREATE TABLE be_pages (
ID bigint(20) unsigned NOT NULL auto_increment,
parentid bigint(20) unsigned NOT NULL ,
name varchar(255) NOT NULL ,
title varchar(255) NOT NULL ,
content text NOT NULL ,
views bigint(20) unsigned NOT NULL ,
priv smallint(2) unsigned NOT NULL ,
view tinyint(1) unsigned NOT NULL ,
sortorder int(11) unsigned NOT NULL ,
PRIMARY KEY (ID)
);
Last edited by Christian; 04-18-06 at 07:04 PM.
Reason: Please use [PHP][/PHP] when posting PHP code!
Also, is there any way to make your DB class give more verbose errors? These error descriptions aren't very useful...I've never used PEAR DB (I'm assuming that's what you're using?)
I think this is the problem, if there's no need to display (a checkbox) is selected the link to this page isn't supposed to show in the menu. But see what happens: only SELECT * FROM ...?? Shouldn't this be Insert Into etc...?
if($no_need_to_display==0)
{
$query= "SELECT * FROM ".$prefix."_pages WHERE parentid = 0";
$pages = $db->getAll($query);
$smarty->assign('pages', $pages);
$smarty->display("addpage.tpl");