i'm new on PDO with PHP and i want your help. i made a function with a select statement and if the query has value greater than 0 it returns the fetch.
$this->result->setFetchMode(PDO::FETCH_OBJ); if ($this->result->rowCount() > 0) { return $this->result->fetch(); } and on my main program i have this
foreach ($category_results as $row){ echo .$row['id_category'].' '. $row['name']; } this command echo only 1 and F twice but if i put only $row it echo all the results correct e.g 1 Food, 2 Drinks. how i can echo the results separately like the example i have above? i want to put them in a list box
thank you