摘要:
SELECT * FROM res AS t1 JOIN (SELECT ROUND(RAND() * ((SELECT MAX(id) FROM res) - (SELECT MIN(id) FROM res)) + (SELECT MIN(id) FROM res)) AS id) AS t2 ... 阅读全文
摘要:
写一函数提示出错Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in D:\www\func\include\mysql.class.php on line 86代码如下:require_once'database.php';require_once'mysql.class.php';/***以语言类型获取最新列表*@param$typeid类型ID*@param$count调用个数*@param$orderby排序类型*@return返回数组**/func 阅读全文
摘要:
今天在Windwos2003服务器上安装Fastcgi+PHP的时候出现了以前没见过的错误做下记录及解决方法:错误如下:FastCGI ErrorThe FastCGI Handler was unable to process the request. Error Details:The FastCGI process exited unexpectedlyError Number: -2147467259 (0x80004005).Error Description: 未指定的错误 HTTP Error 500 - Server Error.Internet Information Ser 阅读全文
摘要:
一直以为mysql随机查询几条数据,就用SELECT*FROM`table`ORDERBYRAND()LIMIT5就可以了。但是真正测试一下才发现这样效率非常低。一个15万余条的库,查询5条数据,居然要8秒以上查看官方手册,也说rand()放在ORDER BY 子句中会被执行多次,自然效率及很低。You cannot use a column with RAND() values in an ORDER BY clause, because ORDER BY would evaluate the column multiple times.搜索Google,网上基本上都是查询max(id) * 阅读全文