geroid Posted April 27, 2009 Share Posted April 27, 2009 Hi I'm searching my database to extract and display a record. I display the record with the following code(this part is working so I won't include the full database select code): <td><input type="text" value=<?echo $row->event_name?> name="eventtitle" size="50" ></td></tr> My problem is that only the first word from the record is displaying in the input box. I want the whole sentence entry to fill the box. Any ideas what is wrong? Quote Link to comment https://forums.phpfreaks.com/topic/155859-solved-only-partial-record-displaying-please-help/ Share on other sites More sharing options...
wildteen88 Posted April 27, 2009 Share Posted April 27, 2009 You need to wrap HTML attribute values within quotes <td><input type="text" value="<?echo $row->event_name?>" name="eventtitle" size="50" ></td></tr> Quote Link to comment https://forums.phpfreaks.com/topic/155859-solved-only-partial-record-displaying-please-help/#findComment-820371 Share on other sites More sharing options...
geroid Posted April 27, 2009 Author Share Posted April 27, 2009 Thanks Wildteen88 That worked perfectly. Could you perhaps help me with one last problem. This update statement is not working and I don't know why. Any ideas? $insert = mysql_query("update $table set event_name='" .$_SESSION['evname']. "', venue_name='".$_SESSION['venuename']."', streetaddress1='".$_SESSION['addr1']."', town='".$_SESSION['town']."', county='".$_SESSION['county']."', event_description='".$_SESSION['content']."', event_date='".$_SESSION['fulldate']."', event_time='".$_SESSION['time']."' where event_num = '".$_SESSION['editwhatrecord']."')") or die("Could not insert data because ".mysql_error()); Quote Link to comment https://forums.phpfreaks.com/topic/155859-solved-only-partial-record-displaying-please-help/#findComment-820386 Share on other sites More sharing options...
premiso Posted April 27, 2009 Share Posted April 27, 2009 Thanks Wildteen88 That worked perfectly. Could you perhaps help me with one last problem. This update statement is not working and I don't know why. Any ideas? $insert = mysql_query("update $table set event_name='" .$_SESSION['evname']. "', venue_name='".$_SESSION['venuename']."', streetaddress1='".$_SESSION['addr1']."', town='".$_SESSION['town']."', county='".$_SESSION['county']."', event_description='".$_SESSION['content']."', event_date='".$_SESSION['fulldate']."', event_time='".$_SESSION['time']."' where event_num = '".$_SESSION['editwhatrecord']."')") or die("Could not insert data because ".mysql_error()); It may be wise to create a new topic for this, and post any error messages you are getting from that and or describe "How" it is not working. Also some code around it may be relevant, if an IF statement is used before it that IF may never be getting acted upon. And for future please us tags around code. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/155859-solved-only-partial-record-displaying-please-help/#findComment-820389 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.