How can I change the following SQL statement to this format? The downloaded PHP source code seems to be in the object-oriented format! I understand it, but the format is not much written. please.
How can I change the following SQL statement to this format?
Read random rand function statements
This is generally the case.
SELECT *
FROM 'table'
WHERE id> = (select floor (MAX (id) * RAND () FROM 'product ')
Order by 'product _ id desc ';
The source code I downloaded should be in the function format! I don't know how to change it.
$ Product_tuijian = $ db-> pe_selectall ('product', array ('product _ istuijian '=> 1, 'product _ state' => 1, 'order by' => 'product _ id desc '),' * ', array (5 ));
How can I change the preceding statement into the following statement?
Reply to discussion (solution)
Search for Object/Relation Mapping (ORM)
What is your PHP source code? it depends on how the source code is parsed.
Phpshe ???
Defined by pe_selectall and _ dowhere.
Your condition id> = (select floor (MAX (id) * RAND () cannot be processed by them
Because the operator is> =
Use the SQL _selectall method directly to execute your query command.
/* = =========== */Public function pe_selectall ($ table, $ where = '', $ field = '*', $ limit_page = array () {// processing condition statement $ sqlwhere = $ this-> _ dowhere ($ where ); return $ this-> SQL _selectall ("select {$ field} from "'. dbpre. "{$ table} '{$ sqlwhere}", $ limit_page );}
Phpshe ???
Defined by pe_selectall and _ dowhere.
Your condition id> = (select floor (MAX (id) * RAND () cannot be processed by them
Because the operator is> =
Use the SQL _selectall method directly to execute your query command.
/* = =========== */Public function pe_selectall ($ table, $ where = '', $ field = '*', $ limit_page = array () {// processing condition statement $ sqlwhere = $ this-> _ dowhere ($ where ); return $ this-> SQL _selectall ("select {$ field} from "'. dbpre. "{$ table} '{$ sqlwhere}", $ limit_page );}
Cool! Which source code is displayed! I have been searching for this source code function for a long time, but it is not that complicated. Modify it.