skania Posted July 2, 2013 Share Posted July 2, 2013 (edited) 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! Edited July 2, 2013 by skania Quote 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 " " Quote 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 Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.