Skip to main content

Unable to save result set in /includes/database.mysql.inc on line 115

Unable to save result set in /includes/database.mysql.inc on line 115

So here’s the scenario… A perfectly working Drupal site, without errors suddenly starts spitting out an error:

Unable to save result set in /includes/database.mysql.inc on line 115

With the help of good ol’ Google, I managed to find FISHTRAP who had also experienced the same error…

In both of our cases it involved a subselect returning more than one row, and throwing the error. In my case, this was from a custom built module which (due to client error), ended up with too many results in the subquery. The trick is in ‘tracking’ the problem in order to solve it.

Here is what FISHTRAP suggested…

In the database.mysql.inc file, in the core includes folder, line 115 is: $result = mysql_query($query, $active_db);, beneath it add:

if (false === $result) {
    var_dump($query);
}

I didn’t get this to do a lot, so instead of var_dump($query); I used trigger_error((“\nquery: “. $query), E_USER_WARNING);, and that wrote the query that threw the error, right into the ‘messaage box’, so it was easy to see and track. So the full code including line 115 is:

$result = mysql_query($query, $active_db);
if (false === $result) {
    trigger_error(("\nquery: ". $query), E_USER_WARNING);
}

Nice work FISHTRAP!

Main Category
  • Drupal
  •  
Secondary Categories
  • Drupal 6
  •  
 
Jon Moore

Search form

Jon Moore

Tips 'n' Snips

 
  • Home
  • General
  • Drupal
    • Drupal 6
    • Drupal 7
    • Module Building
  • HTML & CSS
  • Javascript
  • jQuery
  • PHP
    • CodeIgniter
    • Handy Functions
    • MySQL
  • WordPress
  • About

BBC Technology News

  • Kashmir users kicked off WhatsApp
  • Heavy fine for Chinese firm over unlicensed game
  • Uber had 6,000 US sexual assault reports in two years
  • Electric eel lights up Christmas tree and other news
  • Rory Cellan-Jones: Reporting the news with Parkinson's
More

Sitepoint

  • The Real Future of Remote Work is Asynchronous
  • 7 Ways Developers Can Contribute to Climate Action
  • How to Divert Traffic Using IP2Location in a Next.js Website
  • 10 Zsh Tips & Tricks: Configuration, Customization & Usage
  • Building a Habit Tracker with Prisma, Chakra UI, and React
More

Heart Internet

  • Sponsor Neil Hunter’s amazing Antarctic expedition – for Diabetes UK
  • 15 web design books of 2019 that you should read
  • 12 podcasts for every creative person’s commute
  • Ten TED Talks every designer and web creative should watch before 2019 is over
  • The rise of the robots: Will AI take over graphic design?
More
 

Backend Coders

  • PHP
  • Handy PHP Functions
  • PHP MySQL

Frontend Coders

  • HTML & CSS
  • jQuery
  • Javascript

CMS/CMF Systems

  • Drupal
  • Drupal 6 Specific
  • Drupal 7 Specific
  • Drupal Module Building
  • WordPress

About

  • Home
  • About
 

© Jon Moore 2019

All stock images are from www.istockphoto.com