2015-11-27 208 views
-2

我有一個問題:SELECT FLOOR RAND

$offset_result = mysql_query(" SELECT FLOOR(RAND() * COUNT(*)) AS `offset` `".$slug."_movie`"); 
$offset_row = mysql_fetch_object($offset_result); 
$offset = $offset_row->offset; 
$result = mysql_query(" SELECT * FROM `".$slug."_movie` LIMIT $offset, 10 "); 

如何添加條件:凡STATUS = 1?

僅統計公佈的電影..

現在它擁有所有:/

有人會舉個例子?

+0

是,即使是一個問題嗎? –

回答

0

像這樣:

$result = mysql_query(" SELECT * FROM `".$slug."_movie` WHERE STATUS=1 LIMIT $offset, 10 ");