php - Only first word populating the value field on a submit button -
php - Only first word populating the value field on a submit button -
i doing query , populating buttons results:
$query="select name members active=1 order name";
if simple:
while($row = $rs->fetch_assoc()) { echo $row['name']."<br>; }
i list:
mary123
joe
robert tables
however if :
<table> $column = 0; while($row = $rs->fetch_assoc()) { if ($column == 0) { echo "<tr>"; } echo "<td class='cellnopad'><input type='submit' class='submitbtn' name='name' value=".$row['name']."> </td>"; $column++; if ($column >= 5) {echo "</tr>"; $row++; $column=0; } } echo "</table>";
my buttons
mary123
joe
robert
as can see name tables
gets dropped name , value of robert
shown.
i thought name wasn't beingness displayed due size of text versus button size, have proved not case removing css
, checking $_post
value on individuals.php
. also,if alter name in database robert_tables
works fine.
is there doing wrong? need alter value show both words , space?
your problem relies on fact forgot quote value
parameter of input quotes ''
. see here have:
value=".$row['name'].">
when should instead be:
value='".$row['name']."'>
and breaking generated html
markup, see simple snippet below on how output handled when omit quotes:
class="snippet-code-html lang-html prettyprint-override"><input type='submit' class='submitbtn' name='name' value=asd asd> <input type='submit' class='submitbtn' name='name' value="asd asd">
php html mysqli
Comments
Post a Comment