mysql error: [1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 1' at line 1] in EXECUTE("select max(cDisplayOrder) from Pages where cParentID = LIMIT 1")

Permalink
My PHP is generating the following error:

mysql error: [1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 1' at line 1] in EXECUTE("select max(cDisplayOrder) from Pages where cParentID = LIMIT 1")

I believe it is stemming from :

// Add the page.
$parentPage = Page::getByPath('/' . $sectionListHandle);
$pageSetupData = array(
'name' => $pageName,
'cHandle' => $pHeader_id,
'cDescription' => ''
);
$pt = CollectionType::getByHandle($pChapter_id);
$newPage = $parentPage->add($pt,$pageSetupData);


Specifically, the parent page comes back null and generates an error when I add the page.

I ran this code on one server and it worked fine. Yet somehow when I tried it again on another server, it fails to work and generates the error.

Any ideas on what's causing the issue?

 
arnelf replied on at Permalink Reply
I also have a report of the exact same error. It was reported on our Support Center and I'm currently requesting more specifics from the customer (not sure if this isn't the same person reporting the problem). The only further information that I have to add to the issue is that the person reporting the problem said that they were importing a backup database in through phpMyAdmin in order to recover the Concrete5 site. This is when they get the error.

Any help would be appreciated. If you find anything or have a resolution please let us know. I will also update this post should I get any further relevant information.

Thanks!
Arnel C.
InMotion Hosting Community Support Team