Help me find syntax error

the mail() function

Moderators: macek, egami, gesf

Post Reply
User avatar
gandahar
New php-forum User
New php-forum User
Posts: 112
Joined: Tue Mar 15, 2011 4:05 am

Re: Help me find syntax error

Post by gandahar » Thu Jul 14, 2011 2:08 am

Code: Select all

for ($i = 0; $i < $numItem; $i++) {
   extract($orderedItem[$i]);
   $subTotal += $pd_price * $od_qty;
"<tr class=\"content\">
        <td>". $od_qty . " x " . $pd_name ."</td>
        <td align=\"right\">". displayAmount($pd_price). "</td>
        <td align=\"right\">". displayAmount($od_qty * $pd_price). "</td>
    </tr>". } ."</table>";
missing echo or a $var
I think you can't close a braket like this, try this :

Code: Select all

for ($i = 0; $i < $numItem; $i++) {
   extract($orderedItem[$i]);
   $subTotal += $pd_price * $od_qty;
echo "<tr class=\"content\">
        <td>". $od_qty . " x " . $pd_name ."</td>
        <td align=\"right\">". displayAmount($pd_price). "</td>
        <td align=\"right\">". displayAmount($od_qty * $pd_price). "</td>
    </tr>"; 
} 
echo "</table>";
or like this :

Code: Select all

for ($i = 0; $i < $numItem; $i++) {
   extract($orderedItem[$i]);
   $subTotal += $pd_price * $od_qty;
myVar="<tr class=\"content\">
        <td>". $od_qty . " x " . $pd_name ."</td>
        <td align=\"right\">". displayAmount($pd_price). "</td>
        <td align=\"right\">". displayAmount($od_qty * $pd_price). "</td>
    </tr>"; 
} 
$myVar=$myVar."</table>";

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests