그누보드
[팁]
update table order by random() limit
하우코드
본문
$sql = "
UPDATE $write_table SET ______
WHERE wr_id IN (
SELECT wr_id FROM (
SELECT wr_id FROM $write_table
ORDER BY RAND()
LIMIT 0, 4
) tmp
)
";
sql_query($sql,true);
$sql = "
UPDATE $write_table SET ______
WHERE wr_id IN (
SELECT wr_id FROM (
SELECT wr_id FROM $write_table
where wr_good<4
ORDER BY RAND()
LIMIT 0, 1
) tmp
)
";
sql_query($sql,true);
UPDATE $write_table SET ______
WHERE wr_id IN (
SELECT wr_id FROM (
SELECT wr_id FROM $write_table
ORDER BY RAND()
LIMIT 0, 4
) tmp
)
";
sql_query($sql,true);
$sql = "
UPDATE $write_table SET ______
WHERE wr_id IN (
SELECT wr_id FROM (
SELECT wr_id FROM $write_table
where wr_good<4
ORDER BY RAND()
LIMIT 0, 1
) tmp
)
";
sql_query($sql,true);
댓글목록
등록된 댓글이 없습니다.