I have never encountered this error but found out that it seems to come from a corrupt database, but can also be caused by PHP there is a PHP Databases FAQ which may be of use.
MySQL also has its own information about Table Maintenance which may also be worth looking into. I have also heard that rebooting the MySQL server has helped with the issue, have you tried that as well?
The real question is, do you have a backup? If not, can you run a dump on the data and then just re-create the database and hopefully that will fix it. I will keep doing my research, but that is what I have found so far.
EDIT
After a bit more research, found a few people who had solved this problem by running: SET SQL_BIG_TABLES=1;
which should allow MySQL to use extra memory to save the result set. I am not sure of the repercussion of doing this, so you may want to do some research in MySQL on what that does and what might happen if left on.
But you providing us with more code, a possible table structure and the query you are running will help get to the bottom of the error quicker and more efficiently.
UPDATE
To try the SET SQL
code do something like this:
use with caution and do your research as I do not know what issues this may cause!
mysql_query("SET SQL_BIG_TABLES=1");
$run_sql = mysql_query("SELECT count(*) from tix_orders where order_id='$uniq_transaction_id'",$conn);
mysql_query("SET SQL_BIG_TABLES=0");
That way it only sets it temporary. Although I would consider this a bandaid and would still suggest a database rebuild via a dump of data through the command line mysqldump
, as the error seems to be closely related to corrupt tables.