title: Php resource id overflow error
body: <p>I have a PHP server application harvesting tweets and thus continuously running.
  This application starts failing after a couple of days. Refusing to return results for a mysql select statement. I found out this is due to php resource id overflowing (PHP warning):</p>
  
  <p><strong>-2147483648 is not a valid MySQL result resource</strong></p>
  
  <p>This means the application is running out of possible ids to assign to a resource variable (because of the very high amount of query statements that are being fired). I figured that the answer to this question was to use <strong>mysql_free_result</strong> underneath every mysql select statement so that every resource eventually is freed. <strong>This however did not solve my problem.</strong> </p>
  
  <p>On some forums I read that PHP is unable to <strong>reuse</strong> released resource ids. 
  <em>This would mean the only plausible solution is to reconnect to the mysql database?</em></p>
  
  <p>Some information on my PHP version: </p>
  
  <p><em>PHP 5.5.10-1+deb.sury.org~precise+1 (cli) (built: Mar 27 2014 16:18:01) 
  Copyright (c) 1997-2014 The PHP Group
  Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
      with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies</em></p>
  
  <p>Does anyone have experience with this issue? Could another solution be to use the mysqli extension instead of the regular one? </p>
  
  <p>Thank you!</p>