One thing I've done in situations like this is just load your returned DB data
into an array. Something like this would do:
$dvdarr[$result['call_number']]['Title'] = $result['title'];
$dvdarr[$result['call_number']]['Publisher'] = $result['publisher'];
I approach this by assigning a value to a variable and then comparing to see
if i need to write out a new title
$oldDVD = ;
while ($rows=mysql_fetch_array($result))
{
//decide whether to show the DVD title
if ($oldDVD != $rows['title'])
{
echo trtd.$rows['title']./td/tr;
$oldDVD =
Some good examples of how to deal with this in PHP have already been
given, especially the associative array solution.
The question I have is with something like this, how do you weight out
the pros/cons of code development versus speed?
i.e. for code development breaking the logic up into 2
Thanks to Bastien and TG for their suggestions. I'd been looking at
it Bastien's way, but TG's is probably better suited to what I want to
do. I'd forgotten about that possibility, cramming it all into an
array . . . .
Again, thanks for the help,
Andrew
p.s. I'd be curious about the relative
test both and let us know
bastien
From: Andrew Darby [EMAIL PROTECTED]
To: php-db@lists.php.net
Subject: Re: [PHP-DB] MySQL/PHP Left Join Question
Date: Thu, 25 May 2006 12:33:15 -0400
Thanks to Bastien and TG for their suggestions. I'd been looking at
it Bastien's way, but TG's is probably