Hi!
Im working on a function, and I just can't get it to work.
Here is my function:
function db_select($tabel, $where, $sort){
$SQL = "SELECT * FROM $tabel";
if ($where != ""){
$SQL .= " WHERE $where";
}
if ($sort != ""){
$SQL .= " ORDER BY $sort";
}
$db_result = mysql_query($SQL);
return mysql_fetch_array($db_result);
}
and here is how i try to make it do a loop.
while(db_select("users")){
echo "ole";
}
If I run that code, its just keeps writing "oleoleoleoleoleoleole......".
Can someone help me please? 🙂