dqh19413 2010-09-09 18:44
浏览 40

Mysql表挂起 - 无法在第149行的/home/my_site/public_html/my_file.php中保存结果集

I am getting the following error when trying to run a script from my site:

Warning: mysql_query() [function.mysql-query]: Unable to save result set in /home/my_site/public_html/my_file.php on line 149

$run_sql = mysql_query("SELECT count(*) from tix_orders where order_id='$uniq_transaction_id'",$conn)

I have tried analyzing and doing and extended repair on the table but still the problem persists.

  • 写回答

2条回答 默认 最新

  • dongzan2740 2010-09-09 18:55
    关注

    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.

    评论

报告相同问题?

悬赏问题

  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示
  • ¥15 求三国群英传pl国战时间的修改方法
  • ¥15 matlab代码代写,需写出详细代码,代价私
  • ¥15 ROS系统搭建请教(跨境电商用途)
  • ¥15 AIC3204的示例代码有吗,想用AIC3204测量血氧,找不到相关的代码。