[PHP-DB] PHP Objects and SQL Results

2010-02-12 Thread Paul
Hi all, I'm currently having a problem correctly formatting a table within a while loop. I'm using an object to store the results of a query, and using the while to iterate through it each row to produce the output: $query = SELECT * FROM foo WHERE UserID = .$uID . ORDER BY bar; $result =

Re: [PHP-DB] PHP Objects and SQL Results

2010-02-12 Thread Eric Lee
On Sat, Feb 13, 2010 at 3:26 AM, Paul devine...@msn.com wrote: Hi all, I'm currently having a problem correctly formatting a table within a while loop. I'm using an object to store the results of a query, and using the while to iterate through it each row to produce the output: $query =

Re: [PHP-DB] PHP Objects and SQL Results

2010-02-12 Thread Paul Hollingworth
Thanks for the code Eric, it seems to loosely provide the functionality that I'm after. Just out of interest though, is there no other way to find the next result row in an object apart from dumping it into an array? Thanks, Paul Eric Lee wrote: On Sat, Feb 13, 2010 at 3:26 AM, Paul

Re: [PHP-DB] PHP Objects and SQL Results

2010-02-12 Thread Karl DeSaulniers
Hi Paul, Can't you just? $query = SELECT DISTINCT bar FROM foo WHERE UserID = .$uID; $result = mysql_query($query); while($obj = mysql_fetch_assoc($result) { $bar = $obj['bar']; if ($bar == something) { //do this } } I'm some what a beginner, so sorry if this

Re: [PHP-DB] PHP Objects and SQL Results

2010-02-12 Thread Eric Lee
On Sat, Feb 13, 2010 at 7:46 AM, Paul Hollingworth devine...@msn.comwrote: Thanks for the code Eric, it seems to loosely provide the functionality that I'm after. Just out of interest though, is there no other way to find the next result row in an object apart from dumping it into an array?