Loop inside a table

From: Date: Mon, 20 Jan 2003 17:37:38 +0000
Subject: Loop inside a table
Groups: php.general 
Request: Send a blank email to php-general+get-132269@lists.php.net to get a copy of this message
Hi all, I always make for loops inside tables so I usually don't have problems with it, but this case is a little different. I'm making a mail program for my client to receive a mail each time a customer places an order in his site. Inside the mail program, I declaring a value called $message where an HTML form is being created dynamically, depending on the products selected by the customer or visitor. The problem is that PHP apparently won't let me do a for loop inside this variable. I have something like this: $message = " <HTML> <HEAD> <TITLE>title goes here</TITLE> </HEAD> <BODY> ". for ($x = 0; $x < $num_rows; $x++) { //several lines made dynamically } ." </BODY> </HTML>; and the error goes like: unexpected T_FOR in line xxx (where my for loop is). I've never tried this in the past, so I assumed it had to be done normally but I see I was mistaken. Anyone did this before? What's the problem here? Thanks in advance, Cesar L. Aracena icaam@icaam.com.ar caracena@infovia.com.ar (0299) 156-356688 Neuquén (8300) Capital Argentina

« previous php.general (#132269) next »