Skip to content

Instantly share code, notes, and snippets.

@ss23
Created March 20, 2013 07:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ss23/5202831 to your computer and use it in GitHub Desktop.
Save ss23/5202831 to your computer and use it in GitHub Desktop.
[User Error] Couldn't run query: SELECT DISTINCT count(DISTINCT "MailingList"."ID") AS "0" FROM "MailingList" WHERE ("ID" in (1
GET /silverstripe/SilverStripe-cms-v3.0.5/unsubscribe/index/0ec8ac8b24b68711a15ecd82d01ef7969f1c376c655d057f47fbc4967391c6950afca2a2c93edff074091611987523fd0a05219263cc9e33af15e9c2c1497508/1%3C/p
Line 580 in /var/www/silverstripe/SilverStripe-cms-v3.0.5/framework/model/MySQLDatabase.php
Source
571 }
572
573 public function databaseError($msg, $errorLevel = E_USER_ERROR) {
574 // try to extract and format query
575 if(preg_match('/Couldn\'t run query: ([^\|]*)\|\s*(.*)/', $msg, $matches)) {
576 $formatter = new SQLFormatter();
577 $msg = "Couldn't run query: \n" . $formatter->formatPlain($matches[1]) . "\n\n" . $matches[2];
578 }
579
580 user_error($msg, $errorLevel);
581 }
582
583 /**
584 * Return a boolean type-formatted string
585 *
586 * @param array $values Contains a tokenised list of info about this data type
Trace
Couldn't run query: SELECT DISTINCT count(DISTINCT "MailingList"."ID") AS "0" FROM "MailingList" WHERE ("ID" in (1<)) 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 '))' at line 1
MySQLDatabase.php:580
MySQLDatabase->databaseError(Couldn't run query: SELECT DISTINCT count(DISTINCT "MailingList"."ID") AS "0" FROM "MailingList" WHERE ("ID" in (1<)) | 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 '))' at line 1,256)
MySQLDatabase.php:132
MySQLDatabase->query(SELECT DISTINCT count(DISTINCT "MailingList"."ID") AS "0" FROM "MailingList" WHERE ("ID" in (1<)),256)
DB.php:200
DB::query(SELECT DISTINCT count(DISTINCT "MailingList"."ID") AS "0" FROM "MailingList" WHERE ("ID" in (1<)),256)
SQLQuery.php:949
SQLQuery->execute()
SQLQuery.php:1054
SQLQuery->count(DISTINCT "MailingList"."ID")
DataQuery.php:329
DataQuery->count()
DataList.php:666
DataList->count()
UnsubscribeController.php:86
UnsubscribeController->index(SS_HTTPRequest)
Controller.php:205
Controller->handleAction(SS_HTTPRequest)
RequestHandler.php:184
RequestHandler->handleRequest(SS_HTTPRequest,DataModel)
Controller.php:153
Controller->handleRequest(SS_HTTPRequest,DataModel)
ContentController.php:197
ContentController->handleRequest(SS_HTTPRequest,DataModel)
Director.php:296
Director::handleRequest(SS_HTTPRequest,Session,DataModel)
Director.php:119
Director::direct(/unsubscribe/index/0ec8ac8b24b68711a15ecd82d01ef7969f1c376c655d057f47fbc4967391c6950afca2a2c93edff074091611987523fd0a05219263cc9e33af15e9c2c1497508/1</p,DataModel)
main.php:126
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment