skania Posted July 2, 2013 Share Posted July 2, 2013 I have a table of studies that I get based on studyID. $studyID = $_GET['sid']; $sql = "SELECT * FROM tbl_studies WHERE studyID = $studyID"; $list = mysqli_query($dbcon, $sql); $record = mysqli_fetch_assoc($list); print_r ($record); echo $record['studyName']; print_r ($record) and echo $record['studyName'] both show that there are 2 words for a study name, however, only 1 shows up when I use this: <input type="text" name="studyName" value = <?php echo $record['studyName']; ?>/> Will show "Olfactory" when echo $record['studyName'] shows "Olfactory Study". I'm assuming there is a fix that is relatively simple, but I haven't found one online, any advice is greatly appreciated! Link to comment https://forums.phpfreaks.com/topic/279793-cant-echo-2-words-a-record/ Share on other sites More sharing options...
skania Posted July 2, 2013 Author Share Posted July 2, 2013 Solved it. Turns out you have to surround it with " " Link to comment https://forums.phpfreaks.com/topic/279793-cant-echo-2-words-a-record/#findComment-1439060 Share on other sites More sharing options...
chriscloyd Posted July 2, 2013 Share Posted July 2, 2013 yep! you did nothing wrong but here is a short hand echo that I like to work with. <?=$record['studyName'];?> I hope you have a good time coding Link to comment https://forums.phpfreaks.com/topic/279793-cant-echo-2-words-a-record/#findComment-1439064 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.