Reputation: 6211
I'm dynamically creating a table from a MySQL query. For some reason, the 'notes' field below is only returning the first word of the string, although when I test it with echo($notes)
it shows up just fine. $status
is similarly set, and also is fine. What am I missing? I assume it has something to do with prepopulating the text field with the value. I'm using codeigniter.
$notes = empty($row["notes"]) ? "None" : $row["notes"];
echo($notes);
echo('
<tr class="even">
<td class="status-icons">'.$error_level.'</td>
<td>'.$row["name"].'</td>
<td>'.$status.'</td>
<td class="notes-col">
<input type="text" name="submit_notes" value='.$notes.' class="notes-copy">
</td>
</tr>'
Upvotes: 1
Views: 2611
Reputation: 37233
replace this
value='.$notes.'
with
value="'.$notes.'"
the double quotes are for the Value
because it originally has two quotes like: value=""
Upvotes: 14