Pawan_Agarwal Posted February 1, 2014 Share Posted February 1, 2014 I want to know question related to php and database If I fetch information from database, I get "Steve Jobs" if I print the name in html page echo "<td width=50% align=center>".$row['NAME']."</td></tr>"; BUT If I fetch information from database, I get only "Steve" if I put the name in text field or text box echo "<td width=50% align=center><input type='text' size=50 value=".$row['NAME']."></td></tr>"; Can any one help me ????? Quote Link to comment Share on other sites More sharing options...
Psycho Posted February 1, 2014 Share Posted February 1, 2014 Your problem has nothing to do with PHP or the database - it is an HTML error. You are not putting the values of the HTML parameters in quotes. If a parameter value has no spaces in it this will work, but is still a bad idea. But, in this case the value of the 'value' parameter has a space in it. So, when the user's browser is reading the code it assumes the space is the end of the value. The result of the code you have will be something like: <td width=50% align=center><input type='text' size=50 value=steve jobs></td></tr> What you want is <td width='50%' align='center'><input type='text' size='50' value='steve jobs'></td></tr> Change the code to echo "<td width='50%' align='center'><input type='text' size='50' value='".$row['NAME']."'></td></tr>"; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.