从数据库中检索信息并将其加载到文本框中时,数据会在单引号后消失

I am not sure if I am missing anything from my code to retrieve text from mysql. The data pulls out fine if it's not in a textbox. If I load it into a textbox, then everything after a single quote disappears. So let's say I have the word "let's make this happen" as an entry, all that the textbox would display is "let". I've attached the code below for my while loop which works.

while($row = mysqli_fetch_array($result))
  {
  echo "<input type='hidden' name='id[$i]' value=" . $row['id'] . ">";
  echo "<tr>";
  echo "<td align='center'><input name='resident[$i]' style='width: 80px' type='text' value='" . $row['r_name'] . "' /></td>";
  echo "<td align='center'><input name='room_n[$i]' style='width: 40px' type='text' value='" . $row['room'] . "' /></td>";
  echo "<td align='center'><input name='appt_time[$i]' style='width: 55px' type='text' value='" . date("g:i A", strtotime($row['appttime'])) . "' /></td>";  
  echo "<td align='center'><input name='appt_phone[$i]' style='width: 65px' type='text' value='" . $row['apptphone'] . "' /></td>";
  echo "<td align='center'><input name='name_l[$i]' style='width: 80px' type='text' value='" . $row['l_name'] . "' /></td>";
  echo "<td align='center'><input name='address[$i]' style='width: 90px' type='text' value='" . $row['address'] . "' /></td>";
  echo "<td align='center'><input name='city[$i]' style='width: 70px' type='text' value='" . $row['city'] . "' /></td>";
  echo "<td align='center'><input name='zip[$i]' style='width: 50px' type='text' value='" . $row['zip'] . "' /></td>";
  echo "<td align='center'><input name='buscar[$i]' style='width: 30px' type='text' value='" . $row['buscar'] . "' /></td>";
  echo "<td align='center'><input name='e_name[$i]' style='width: 60px' type='text' value='" . $row['escort_name'] . "' /></td>";
  echo "<td align='center'><input name='transfer[$i]' style='width: 40px' type='text' value='" . $row['transfer'] . "' /></td>";
  echo "<td align='center'><input name='comments[$i]' style='width: 80px' type='text' value='" . $row['comments'] . "' /></td>";
  echo "<td align='center'><input name='out[$i]' style='width: 70px' type='text' value='" . date("g:i A", strtotime($row['depart'])) . "' /></td>";
  echo "<td align='center'><input name='delete[$i]' type='checkbox' value='" . $row['id'] . "' /></td>";
  echo "</tr>";
  ++$i;  
  }

echo "</table>";

Thank you for your help :). I'm sure I'm just missing something small.

You need to scape special characters.

Use: addslashes($row["your_value"])