Chips Posted June 26, 2006 Share Posted June 26, 2006 EDIT: Fixed it myself, stupid mistake of not thinking :/ Obviously value=" <?php blah blah ?>" solves it. What a numpty.My issue lies with inserting a value from the database into a value for an input field - as so:[code]<tr><td>Last Name:</td><td><input type='text' value='<?php echo $rows['lname']; ?>' name='lnameEDIT'/></td></tr>[/code]The issue is that when I am obtaining a value from the database that includes a ' character, it cuts off the value right there. If I echo the value to the page, it comes out correctly (as in o'neil), but if I try to put the value of the input field as (o'neil), it just get (o)... effectively disregarding everything after the ' character. I cannot find out how to output the field value with this character, tried using addslashes, but it adds a slash, but still cuts off everything from ' onwards.Has anyone got any suggestions/work arounds. I think its with the input field not taking a ' in a value, not php itself - just looking for a solution!Thanks Link to comment https://forums.phpfreaks.com/topic/12922-inserting-a-value-from-a-database-into-input-field-solved/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.