Hi, Please can someone tell me how to extract results from this: function selects($select) { $this->result = mysql_query($select,$this->connection); $this->row = mysql_fetch_assoc($select); } function getRes() { while ($res = mysql_fetch_array($this->result)) { $this->reser[] = $res; } return $this->reser; } $current = new database; $current->selects("SELECT * FROM table"); $cresults = $current->getRes(); Code (markup): How would a print out the results? Cheers, Adam
foreach ($cresults as $row) { echo $row[col1] . "," . $row[col2] . "<br>"; } PHP: Change col1, col2 to your column names etc.
What i am trying to do is the following which i cannot work out how to do. Basically with the above i want to loop through the results checking against another table to see if any of the "country" fields match. So when i have the results from $cresults i need to check them against table2 to see if the country fields match.