Hi there, would someone help me with this please?

I accomplished this in the past and now cannot remember how I did it or find it on the web.

Using a standard while loop I want to define a string prior and then add to it each time around I know it something like

$string = . $row['unit'];
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
	{
	   if ($row['sts'] ==1){

	     echo "<tr>
		<td>" . $row['product_description'] . "</td>
		<td>" . $row['unit'] . "</td><td>&pound;" . $row['unit_price'] . "</td>
		<td><input type='text' size='4' name='" . $row['product_code'] . "_qty' /><td>
		<td>ln tot</td>
		 </tr>";


	   }
	}

Thanks in a advance - this is my first post so I hope I have used the correct format and this is the correct place.

A

Recommended Answers

All 2 Replies

Member Avatar for diafol
$str = "";
while(...){
 $str .= "...";
}

ardav, thanks, I have been trying to find a way of replying to you personally - as mentioned I normally find my own solutions but I am 'under the gun' on this one. Good man and thanks again, now I see it it looks intuitive but I could have stared at the mark-up for hours and not worked it out - gotta change my servers and learn PHP 5 now - so it goes. Respect!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.