Re: [PHP-DB] Looping within a string?

2004-12-16 Thread Jason Wong
On Friday 17 December 2004 10:33, Chris Payne wrote:

 Im having to send an email with looped results, but Im having problems. 
 I can send an email no problem, and this code works OUTSIDE of the string,
 but not inside, can anyone see what is going wrong?

Please explain what you are doing. A string is a string. Code doesn't execute 
inside a string. What else are you doing to the string?

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
Pardon this fortune.  Database under reconstruction.
*/

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



RE: [PHP-DB] Looping within a string?

2004-12-16 Thread Chris Payne
Hi there,

Well basically I have a list of items and their prices etc . which have
to be sent via email, so I need to store the data in a string.  I THOUGHT I
could execute the loop with all the elements (Such as table rows etc ...)
inside a string, but I was wrong, so how can I store the data PLUS the table
data into a string?  It has to be an HTML email and I'm stumped.  I can send
an email no problem, but not with all the data, just the last row in the
data.

Chris

On Friday 17 December 2004 10:33, Chris Payne wrote:

 Im having to send an email with looped results, but Im having problems. 
 I can send an email no problem, and this code works OUTSIDE of the string,
 but not inside, can anyone see what is going wrong?

Please explain what you are doing. A string is a string. Code doesn't
execute 
inside a string. What else are you doing to the string?

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
Pardon this fortune.  Database under reconstruction.
*/

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

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.816 / Virus Database: 554 - Release Date: 12/14/2004
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.816 / Virus Database: 554 - Release Date: 12/14/2004
 

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



RE: [PHP-DB] Looping within a string?

2004-12-16 Thread David Robley
On Fri, 17 Dec 2004 13:54, Chris Payne wrote:

 Hi there,
 
 Well basically I have a list of items and their prices etc . which
 have
 to be sent via email, so I need to store the data in a string.  I THOUGHT
 I could execute the loop with all the elements (Such as table rows etc
 ...) inside a string, but I was wrong, so how can I store the data PLUS
 the table
 data into a string?  It has to be an HTML email and I'm stumped.  I can
 send an email no problem, but not with all the data, just the last row in
 the data.
 
 Chris
 
 On Friday 17 December 2004 10:33, Chris Payne wrote:
 
 I?m having to send an email with looped results, but I?m having problems.
 I can send an email no problem, and this code works OUTSIDE of the
 string, but not inside, can anyone see what is going wrong?
 
 Please explain what you are doing. A string is a string. Code doesn't
 execute
 inside a string. What else are you doing to the string?
 

Create the output in the same manner as you would use if you were displaying
it; in other words, loop through the source (database, whatever) adding the
formatting as required. Instead of echoing the output to screen, append it
to a variable. Voila, you have the data all in one variable.


-- 
David Robley

My pencil is dull, said Tom pointlessly.

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



Re: [PHP-DB] Looping within a string?

2004-12-16 Thread Jason Wong
On Friday 17 December 2004 11:24, Chris Payne wrote:

Please do not top post.

 Well basically I have a list of items and their prices etc . which have
 to be sent via email, so I need to store the data in a string.  I THOUGHT I
 could execute the loop with all the elements (Such as table rows etc ...)
 inside a string, but I was wrong, so how can I store the data PLUS the
 table data into a string?

By 'data' I assume you mean data from the database and by 'table data' I 
assume you mean the HTML markup to output a table?

  $text = '';
  while ($row = mysql_fetch_array($sql_resultc)) {
$text .= 'some html markup' . $row['id'] . 'more html';
  }

Now stick $text somewhere in the body of your mail.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
 Professor: Oh, dear. She's stuck in an infinite loop and he's an idiot. 
   Well, that's love for you.
*/

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