Monday, January 12, 2009

drupal installation error

* user warning: You have an error in your SQL syntax

Nikos101 - April 16, 2008 - 12:41

HI, I've tried to install Drupal locally and get this error, could it be the mysql server that I'm using or drupal?

* user warning: 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 ') ORDER BY fit DESC LIMIT 0, 1' at line 1 query: SELECT * FROM drupal_menu_router WHERE path IN () ORDER BY fit DESC LIMIT 0, 1 in C:\Documents and Settings\Administrator\My Documents\Computing\htdocs\ecommercetotal\demos\drupal-6.2\includes\menu.inc on line 315.
* user warning: 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 ') ORDER BY fit DESC LIMIT 0, 1' at line 1 query: SELECT * FROM drupal_menu_router WHERE path IN () ORDER BY fit DESC LIMIT 0, 1 in C:\Documents and Settings\Administrator\My Documents\Computing\htdocs\ecommercetotal\demos\drupal-6.2\includes\menu.inc on line 315.

 
 
 
 

Have found solution.

It is ugly, but I don't know why drupal so lol :)

You need to fix two lines at two files.

1. includes/menu.inc, line 315, add $placeholders && :

if ($placeholders && $router_item = db_fetch_array(db_query_range('SELECT * FROM {menu_router} WHERE path IN ('. implode (',', $placeholders) .') ORDER BY fit DESC', $ancestors, 0, 1))) {

2. includes/batch.inc, line 15, add !:
if (isset($_REQUEST['id']) && $data = db_result(db_query("SELECT batch FROM {batch} WHERE bid = %d AND token != '%s'", $_REQUEST['id'], drupal_get_token($_REQUEST['id'])))) {