I am reading data from MySQL into a form built in PHP so I can edit it. This is READ and not WRITE. When I post the data into a text box anything with an apostrophe truncates the data at the apostrophe. I have searched and read and can’t find anything addressing this issue. There’s lots on the un-sanitized writing to MySQL but not this issue. Any suggestions would be greatly appreciated.
echo "<form id='modify' name='modify' method='post' action='modify.php'>";
echo "Artist: " . "<input type='text' name='partist' size='40' autofocus tabindex='1' value='". $record['artist'] ."'/><br>";
echo "Title: " . "<input type='text' name='ptitle' size='50' tabindex='2' value='". $record['title'] ."'/><br>";
The code goes on for another 22 fields but these are the only ones with apostrophes.