I have a button inside a while loop, which I would like to use a bootstrap style on. I actually thought I just could replace my current HTML button code, but I get the error: syntax error, unexpected 'form' (T_STRING), expecting ',' or ';'. Is there a smart way to do that somehow?
while($row = $res->fetch_assoc()) {
echo "Id: " . $row["id"]. "<br>" .
"<button>Read More</button><br><br>";
}
This is the button I would like to set in my while loop:
<div class="form-group">
<label class="col-md-4 control-label"></label>
<div class="col-md-4">
<button type="submit" class="btn btn-warning" >Send <span class="glyphicon glyphicon-send"></span></button>
</div>
</div>
I tried to set the bootstrap button code in my while loop like this:
while($row = $res->fetch_assoc()) {
echo "Id: " . $row["id"]. "<br>" .
"
<div class="form-group">
<label class="col-md-4 control-label"></label>
<div class="col-md-4">
<button type="submit" class="btn btn-warning">Send <span class="glyphicon glyphicon-send"></span></button>
</div>
</div>
";
}
' 'around my html button I get printed the bootstrap button. Is that correct?\") OR you can choose to use single quotes in either your html or in your php, other wise you will severely confuse the parser, and start opening and closing strings everywhere ;)