You are here: Re: [PHP] I'm having a blond moment with a while loop??? « PHP « IT news, forums, messages
Re: [PHP] I'm having a blond moment with a while loop???

Posted by Marek Kilimajer on 10/19/37 11:15

George Pitcher wrote:
> Hi guys,
>
> I'm doing something dumb but I can't see it.
>
> The basic premise is:
>
> sql search of orders sorted by customer
> set g_customer_id to ''
> loop through resultset
> if customer_id not same as last record's customer_id (g_customer_id)
> get customer email details
> set up message header if this is the first record for a customer
> set item details
> else
> set item details
> set g_customer_id to customer_id
> endif
> send email
> end loop

Should not be line "set g_customer_id to customer_id" be in the "if"
part? It's certainly useless in the "else" part as it's already equal to
customer_id ;)

>
> The problem is that as a sample I have two records from one demo customer
> (me) and I can only get my email to handle one record - either sending
> separate records for each record or one email covering the last record only
>
> Its as if I should have another inner loop
>
> Any tips
>
> MTIA
>
> George
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация