i am hitting my head here , how do i put a while loop inside a variable ?
$variable="
<table style='margin-bottom:30px;'>
<tr class='table_heads'>
<b><td style='border: 1px solid #d8d8d8;padding: 2px 7px 2px 7px;background: #ddd;font-weight: bold;font-size: 11px;'>S.No</td>
<td style='border: 1px solid #d8d8d8;padding: 2px 7px 2px 7px;background: #ddd;font-weight: bold;font-size: 11px;'>Ingredients</td>
<td style='border: 1px solid #d8d8d8;padding: 2px 7px 2px 7px;background: #ddd;font-weight: bold;font-size: 11px;'>Weight <small><i> - (In Grams)</i></small></td>
<td style='border: 1px solid #d8d8d8;padding: 2px 7px 2px 7px;background: #ddd;font-weight: bold;font-size: 11px;'>Fat</td>
<td style='border: 1px solid #d8d8d8;padding: 2px 7px 2px 7px;background: #ddd;font-weight: bold;font-size: 11px;'>Sweetness</td>
<td style='border: 1px solid #d8d8d8;padding: 2px 7px 2px 7px;background: #ddd;font-weight: bold;font-size: 11px;'>Solid 1</td>
<td style='border: 1px solid #d8d8d8;padding: 2px 7px 2px 7px;background: #ddd;font-weight: bold;font-size: 11px;'>Solid 2</td>
<td style='border: 1px solid #d8d8d8;padding: 2px 7px 2px 7px;background: #ddd;font-weight: bold;font-size: 11px;'>Anti-Freezing Power</td>
</tr>
while(somethign here too){ // here is the problem even i try to concenite this it dosent work ..
<tr class='table_headsnonw' style='font-size:12px;'>
<td>1</td>
<td>
3
</td>
<td>300</td>
<td>300</td>
<td>300</td>
<td>300</td>
<td>300</td>
<td>300</td>
</tr>
}
<tr class='table_heads'>
<b><td style='border: 1px solid #d8d8d8;padding: 2px 7px 2px 7px;background: #ddd;font-weight: bold;font-size: 11px;'>S.No</td>
<td style='border: 1px solid #d8d8d8;padding: 2px 7px 2px 7px;background: #ddd;font-weight: bold;font-size: 11px;'>Ingredients</td>
<td style='border: 1px solid #d8d8d8;padding: 2px 7px 2px 7px;background: #ddd;font-weight: bold;font-size: 11px;'>Weight <small><i> - (In Grams)</i></small></td>
<td style='border: 1px solid #d8d8d8;padding: 2px 7px 2px 7px;background: #ddd;font-weight: bold;font-size: 11px;'>0</td>
<td style='border: 1px solid #d8d8d8;padding: 2px 7px 2px 7px;background: #ddd;font-weight: bold;font-size: 11px;'>0</td>
<td style='border: 1px solid #d8d8d8;padding: 2px 7px 2px 7px;background: #ddd;font-weight: bold;font-size: 11px;'>0</td>
<td style='border: 1px solid #d8d8d8;padding: 2px 7px 2px 7px;background: #ddd;font-weight: bold;font-size: 11px;'>0</td>
<td style='border: 1px solid #d8d8d8;padding: 2px 7px 2px 7px;background: #ddd;font-weight: bold;font-size: 11px;'>0</td>
</tr>
";
i have added the code adove the problem is i have HTML inside php variable and then some html is produced by while loop from database and then all of them needs to be storede in a variable so that i can print it .
i cant find a way to solve this ..
$variablebefore the loop, in yourwhileloop add to$variable.