您好,欢迎访问一九零五行业门户网

下面这个SQL语句怎么改成 这个格式啊?

下载了一个php源码 好像是面向对象格式吧! 我看懂 但是格式写不多 拜托啦
下面这个sql语句怎么改成 这个格式啊?
随机rand函数的语句读取
一般都是这样写的
select * 
from `table` 
where id >= (select floor( max(id) * rand()) from `product` ) 
order by 'product_id desc' ;
我下载的源码应该是写成函数的格式啦! 我不知道怎么改啦
$product_tuijian = $db->pe_selectall('product', array('product_istuijian'=>1, 'product_state'=>1, 'order by'=>'product_id desc'), '*', array(5));
请把上面的语句变成 下面的语句 改怎么写啊?
回复讨论(解决方案) 搜索 object/relation mapping(orm)
你下的是什么php源码,这个要看源码是怎么解析的
phpshe ?
由 pe_selectall 和 _dowhere 定义可知
你的条件 id >= (select floor( max(id) * rand()) 不可能经过他们处理
因为算符是 >=
直接使用 sql_selectall 方法来执行你的查询指令
/* ====================== 快速mysql处理函数 ====================== */ public function pe_selectall($table, $where = '', $field = '*', $limit_page = array()) { //处理条件语句 $sqlwhere = $this->_dowhere($where); return $this->sql_selectall(select {$field} from `.dbpre.{$table}` {$sqlwhere}, $limit_page); }

phpshe ?
由 pe_selectall 和 _dowhere 定义可知
你的条件 id >= (select floor( max(id) * rand()) 不可能经过他们处理
因为算符是 >=
直接使用 sql_selectall 方法来执行你的查询指令
/* ====================== 快速mysql处理函数 ====================== */ public function pe_selectall($table, $where = '', $field = '*', $limit_page = array()) { //处理条件语句 $sqlwhere = $this->_dowhere($where); return $this->sql_selectall(select {$field} from `.dbpre.{$table}` {$sqlwhere}, $limit_page); }

好牛啊!这都看出来是哪个源码 啦! 我找了半天就这个源码功能差不多,没那么复杂的地方。修改 一下。
其它类似信息

推荐信息