mardi 6 octobre 2015

Php Sql Pdo random Values to rows

I use a PDO Wrapper and have this:

# DB
$db = DBWrapper::getInstance();
$table = "users";   

$columns = array("date1","date2","date3");
$where   = array('date1 > :id');
$values  = array('id' => 0);
$orderbyrandom = array('RAND()');

$result_set = $db->select($table, "*", $where, $values, $orderbyrandom, 15);

foreach($result_set as $result) {
    var_dump($result);
}

This give me a random integer in every row,

now how can I accomplish to give every row different integer values?

Again at the moment all rows get the same value.




Aucun commentaire:

Enregistrer un commentaire