dve stvari
1) gornji kod treba da bude::
Kôd:
function spec_rand($from,$to,$n){
$new_to=($n * ($to/2 + 0.5));
$u=rand($from,$new_to);
$final=round($to*(log(($u+($n/$to)),($new_to))));
if($final==0){ $final=1; }
return $final;
}
2) uh, zakomplikovah ga bez potrebe, ovo resava stvar
(tako mi se bar cini)
Kôd:
$n=3;
$SQL="select id, name, (FLOOR(1 + (RAND() * 99)) * (product_factor*$n)) as new_ord
from products
order by new_ord desc
limit 0,20";