Q:

Only first word populating the value field on a submit button

I am doing a query and populating buttons with the results:
$query="select  name from members where active=1 order by name";

If I do a  simple:
while($row = $rs->fetch_assoc()) {
    echo $row['name']."<br>;
}

I get a list:

Mary123
JOE
Robert Tables

However if I :
<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 look like

Mary123
JOE
Robert

As you can see the name Tables gets dropped from the name and only the value of Robert is shown.
I initially thought the name wasn't being displayed due to the size of the text versus button size, but I have proved that is not the case by removing the CSS and checking the $_POST value on individuals.php. Also,if I change the name in the database to Robert_Tables it works fine.
Is there something I am doing wrong? What do I need to change to get the value to show both words and the space?

A:

Your problem relies on the fact that you forgot to quote the value parameter of the input with quotes ''. See here you have:
 value=".$row['name']."> 

when it should instead be:
 value='".$row['name']."'> 

And that is breaking your generated html markup, see simple snippet below on how the output is handled when you omit the quotes: 

<input type='submit' class='submitbtn' name='name' value=asd asd>
<input type='submit' class='submitbtn' name='name' value="asd asd">

