On 12 February 2010 23:46, Paul Hollingworth wrote:
> 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
Hi,
Why don't you just try the following:
$query = "SELECT * FROM foo WHERE UserID = " .$uID . " ORDER BY bar";
$result = mysql_query($query);
//get the first row
$row = mysql_fetch_object($result);
//get the next row
while ($next = mysql_fetch_object($result)) {
//do something with row/next
On Sat, Feb 13, 2010 at 7:46 AM, Paul Hollingworth wrote:
> 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?
>
>
Paul
Apo
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 t
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 wrote:
On Sat, Feb 13, 2010 at 3:26 AM, Paul 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 = "SELECT * FR
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";
$resul