RE: [PHP-DB] query and display acting weird...

2003-07-25 Thread Aaron Wolski
As usual.

John knows best.

Thanks!

Aaron

-Original Message-
From: CPT John W. Holmes [mailto:[EMAIL PROTECTED] 
Sent: July 25, 2003 3:05 PM
To: Aaron Wolski; [EMAIL PROTECTED]
Subject: Re: [PHP-DB] query and display acting weird...

Probably need:

ORDER BY t.manufacturer, t.colourID

---John Holmes...

- Original Message - 
From: "Aaron Wolski" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, July 25, 2003 2:58 PM
Subject: [PHP-DB] query and display acting weird...


> Hi Guys,
>  
> Code:
>  
> echo " style=\"font-family:monospace;\">\n";
> 
> $query = "select t.manufacturer, t.id, t.colour, t.colourID,
t.type,
> p.thread_index FROM kcs_threads t LEFT JOIN kcs_patternthreads p ON
t.id
> = p.thread_index WHERE p.pattern_index = '$id' OR p.pattern_index IS
> NULL ORDER BY t.colourID";
> 
> $thread_manufacturer = '';
> 
> $result = db_query($query);
> while($thread = db_fetch($result)) {
> 
> if($thread_manufacturer != $thread['manufacturer']) { 
> echo " class=\"adminEditLink\">{$thread['manufacturer']}\n"; 
> $thread_manufacturer = $thread['manufacturer'];
> }
> }
> 
> echo "\n";
>  
> In my select box I am getting results like:
>  
> Canterbury Cross Fabrics
> Zweigart
> Permin
> Zweigart
>  
> I SHOULD be getting:
>  
> Canterbury Cross Fabrics
> Zweigart
> Permin
>  
>  
> This was once working.. as it should have but today more data was
dumped
> into the table which is causing the second Zweigart to be displayed. 
> 
> If I group the manufacturer in the query then I only one record
> displayed for the corresponding manufacturers. 
> 
> Any clue how I can make it so that everything is sorted under grouped
> manufacturers but still get ALL the results for the manufacturer at
the
> same time? 
> 
> Have over 4000 records which was causing a LONG loading time in the
> browser so John Holmes gave me the above query to replace where I had
3
> queries doing the same thing. 
> 
> 
> ANY thoughts would be greatly welcomed! 
> 
> Thanks 
> 
> Aaron
> 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] query and display acting weird...

2003-07-25 Thread CPT John W. Holmes
Probably need:

ORDER BY t.manufacturer, t.colourID

---John Holmes...

- Original Message - 
From: "Aaron Wolski" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, July 25, 2003 2:58 PM
Subject: [PHP-DB] query and display acting weird...


> Hi Guys,
>  
> Code:
>  
> echo " style=\"font-family:monospace;\">\n";
> 
> $query = "select t.manufacturer, t.id, t.colour, t.colourID, t.type,
> p.thread_index FROM kcs_threads t LEFT JOIN kcs_patternthreads p ON t.id
> = p.thread_index WHERE p.pattern_index = '$id' OR p.pattern_index IS
> NULL ORDER BY t.colourID";
> 
> $thread_manufacturer = '';
> 
> $result = db_query($query);
> while($thread = db_fetch($result)) {
> 
> if($thread_manufacturer != $thread['manufacturer']) { 
> echo " class=\"adminEditLink\">{$thread['manufacturer']}\n"; 
> $thread_manufacturer = $thread['manufacturer'];
> }
> }
> 
> echo "\n";
>  
> In my select box I am getting results like:
>  
> Canterbury Cross Fabrics
> Zweigart
> Permin
> Zweigart
>  
> I SHOULD be getting:
>  
> Canterbury Cross Fabrics
> Zweigart
> Permin
>  
>  
> This was once working.. as it should have but today more data was dumped
> into the table which is causing the second Zweigart to be displayed. 
> 
> If I group the manufacturer in the query then I only one record
> displayed for the corresponding manufacturers. 
> 
> Any clue how I can make it so that everything is sorted under grouped
> manufacturers but still get ALL the results for the manufacturer at the
> same time? 
> 
> Have over 4000 records which was causing a LONG loading time in the
> browser so John Holmes gave me the above query to replace where I had 3
> queries doing the same thing. 
> 
> 
> ANY thoughts would be greatly welcomed! 
> 
> Thanks 
> 
> Aaron
> 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] query and display acting weird...

2003-07-25 Thread Aaron Wolski
Hi Guys,
 
Code:
 
echo "\n";

$query = "select t.manufacturer, t.id, t.colour, t.colourID, t.type,
p.thread_index FROM kcs_threads t LEFT JOIN kcs_patternthreads p ON t.id
= p.thread_index WHERE p.pattern_index = '$id' OR p.pattern_index IS
NULL ORDER BY t.colourID";

$thread_manufacturer = '';

$result = db_query($query);
while($thread = db_fetch($result)) {

if($thread_manufacturer != $thread['manufacturer']) { 
echo "{$thread['manufacturer']}\n"; 
$thread_manufacturer = $thread['manufacturer'];
}
}

echo "\n";
 
In my select box I am getting results like:
 
Canterbury Cross Fabrics
Zweigart
Permin
Zweigart
 
I SHOULD be getting:
 
Canterbury Cross Fabrics
Zweigart
Permin
 
 
This was once working.. as it should have but today more data was dumped
into the table which is causing the second Zweigart to be displayed. 

If I group the manufacturer in the query then I only one record
displayed for the corresponding manufacturers. 

Any clue how I can make it so that everything is sorted under grouped
manufacturers but still get ALL the results for the manufacturer at the
same time? 

Have over 4000 records which was causing a LONG loading time in the
browser so John Holmes gave me the above query to replace where I had 3
queries doing the same thing. 


ANY thoughts would be greatly welcomed! 

Thanks 

Aaron