I am fetching record from the mysql table into textbox for editing purpose. but when i fetch into text box if content of the table is "ABC XYZ" then its displaying only xyz in the text box i am fetching usign this code $query="select * from table where id=1"; $res=mysql_query($res); echo "<form method=post action=testdata.php name=frmedit>"; while($myar=mysql_fetch_array($res)) { echo "<input type=text name=txtname value=".$myar['name'].">"; } echo "</form>"; please help
Not sure if this is the problem without seeing a full text example, but you could add it anyway. echo "<input type=text name=txtname value=\"" . htmlentities($myar['name']); >"; PHP:
But according to your code.., $query="select * from table where id=1"; PHP: this will fetch only one record......!!
That could very well be the problem. Without quotes it might be cutting off the content at the first space. I'm surprised you didn't get any errors with your current code though.