-1

I am getting this error Parse error: syntax error, unexpected '}' when printing $html.

This is my code:

$html= while($rowe=$rese->fetch_array())
             { ;
$html .='<div class="row" style="margin-bottom:0;">
          <div class="col-md-12 form-group">
            <label style="font-weight:bold">Summary</label>
            <p>';
            $html .=ucfirst($rowe['summary']);
            $html .='</p>
            </div>
            </div><hr>';
            $html .= } ;

3 Answers3

0

Bind only html in your variable:

while($rowe=$rese->fetch_array())
{ 
            $html ='<div class="row" style="margin-bottom:0;"><div class="col-md-12 form-group"><label style="font-weight:bold">Summary</label><p>';
            $html .=ucfirst($rowe['summary']);
            $html .='</p>
            </div>
            </div><hr>';
} 
Ahmed Ginani
  • 6,522
  • 2
  • 15
  • 33
0

Remove this : $html .= } ;

$html = "";
while($rowe=$rese->fetch_array())
             { 
$html .='<div class="row" style="margin-bottom:0;">
          <div class="col-md-12 form-group">
            <label style="font-weight:bold">Summary</label>
            <p>';
            $html .=ucfirst($rowe['summary']);
            $html .='</p>
            </div>
            </div><hr>';
             }
Dhara Parmar
  • 8,021
  • 1
  • 16
  • 27
0

You have multiple errors , correct way is

while($rowe=$rese->fetch_array()) {
            $html .= '<div class="row" style="margin-bottom:0;"><div class="col-md-12 form-group"><label style="font-weight:bold">Summary</label><p>'.ucfirst($rowe["summary"]).'</p></div></div><hr>';
        }
Rahul
  • 2,374
  • 2
  • 9
  • 17