Author:
rainerborene
Version:
0.1
Released:
10 March 2011
Category:
Workflow

New#1: SQL syntax error when editing a page

Using the latest Symphony integration branch, I'm getting the following error when editing a page:

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 'WHERE id = 7' at line 1 An error occurred while attempting to execute the following query SELECT SQL_CACHE guid sym_pages WHERE id = 7

The backtrace refers to:

schema_migration/lib/class.migrationmanager.php:42] MySQL->fetchVar();
schema_migration/lib/class.migrationmanager.php:88] MigrationManager::getPagesTypes();
schema_migration/extension.driver.php:147] MigrationManager::migratePages();

I think I found a solution to the syntax error. On line 42 of the MigrationManager class, the query is missing FROM, so it needs to change from this:

$guid = Symphony::Database()->fetchVar('guid', 0, "SELECT guid `sym_pages` WHERE id = {$type['page_id']}");

to this:

$guid = Symphony::Database()->fetchVar('guid', 0, "SELECT guid FROM `sym_pages` WHERE id = {$type['page_id']}");

This appears to solve my issue.

Please login to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details