Hello,
I want to display all data from database (repeat) and not only the last one:
In classic php I do this using:
...
$row_record = mysql_fetch_assoc($record);
do
{
echo 'Record <br />';
}while($row_record = mysql_fetch_assoc($record))
In advanced php (using class)
I decided to create my own way, so here I arrived:
//class db
...
public function fetch()
{
$this -> result = mysql_fetch_assoc($this -> query($this -> query));
return $this -> result;
}
//end class
$dbh = new db;
$dbh -> query("select * from player");
$result = $dbh -> fetch();
do
{
echo 'a';
}while($result = $dbh -> fetch())
I have created the same concept as the classic php way but it's not working ...
if I print_r($result), It will gives me an array of the data (so it work in single mode)...
Can anyone gives me an idea =) thank you