FuZzI Posted November 15, 2007 Share Posted November 15, 2007 Hello, I'm new here and a bit new to php also .. Here is the problem. I have a web based game and I wanted to add a note book section. When I write in the note book, it saves the note into the database but it doesn't show up when you view the note book, which I find is weird. Here is the script for the note book page: <?PHP include "header2.php"; include "_menu.php"; if (($_POST['change_notes']) && ($_POST['notes'])){ $notes=strip_tags($_POST['notes']); mysql_query("UPDATE users SET notes='$notes' WHERE username='$username'"); echo "Your notes has been updated"; } ?> <html> <body> <center> <br> <table width="713" border="1" class="thinline" rules="none" cellpadding="0" cellspacing="0" bordercolor="" bgcolor=""> <tr> <td width="709" height="21" class="header"> <div align="center">Note Pad </div></td> </tr> <tr> <td ><table width="100%" height="383" border="0" cellpadding="2" cellspacing="2"> <tr> <td><form action="" method="POST"> <br> <center><textarea name="notes" cols="100" rows="15" id="notes"><?php echo "$fetch->notes"; ?></textarea></center> <br> <br> <center><input name="change_notes" type="submit" id="change_notes" value="submit"> </center><br> </form></td> </tr> </table></td> </tr> </table> <br> <p> </p> </center><p> <?php include_once"footer.php"; ?> </body> </html> Any help would really be appreciated, been stuck with this for over months! Thank you, FuZzI Quote Link to comment https://forums.phpfreaks.com/topic/77514-solved-note-book-feature-problem-wont-show/ Share on other sites More sharing options...
Daniel0 Posted November 15, 2007 Share Posted November 15, 2007 Try echo $fetch->notes; instead of echo "$fetch->notes"; Also, see: http://php.net/string#language.types.string.parsing.complex Quote Link to comment https://forums.phpfreaks.com/topic/77514-solved-note-book-feature-problem-wont-show/#findComment-392355 Share on other sites More sharing options...
FuZzI Posted November 15, 2007 Author Share Posted November 15, 2007 Thanks for replying quickly! Sadly, it didn't work. <?php echo $fetch->notes; ?> Quote Link to comment https://forums.phpfreaks.com/topic/77514-solved-note-book-feature-problem-wont-show/#findComment-392377 Share on other sites More sharing options...
Daniel0 Posted November 15, 2007 Share Posted November 15, 2007 Where does $fetch come from? Quote Link to comment https://forums.phpfreaks.com/topic/77514-solved-note-book-feature-problem-wont-show/#findComment-392412 Share on other sites More sharing options...
FuZzI Posted November 16, 2007 Author Share Posted November 16, 2007 Doesn't "fetch" mean like to grab something, a coding? In this case, I want to fetch the field notes. Quote Link to comment https://forums.phpfreaks.com/topic/77514-solved-note-book-feature-problem-wont-show/#findComment-392662 Share on other sites More sharing options...
Daniel0 Posted November 16, 2007 Share Posted November 16, 2007 Yes, but the object has to be created before it can used, so if you have to object called $fetch then you can't use it. Quote Link to comment https://forums.phpfreaks.com/topic/77514-solved-note-book-feature-problem-wont-show/#findComment-392713 Share on other sites More sharing options...
FuZzI Posted November 16, 2007 Author Share Posted November 16, 2007 What object? Quote Link to comment https://forums.phpfreaks.com/topic/77514-solved-note-book-feature-problem-wont-show/#findComment-392723 Share on other sites More sharing options...
FuZzI Posted November 16, 2007 Author Share Posted November 16, 2007 I finally understood what you meant! Thanks alot for helping out, I've finally figured out why it wasn't working. This was the problem .. I was missing the object thing .. $notes = $row[notes]; Which I added into my header that I included into the notes.php file. Thanks alot! Quote Link to comment https://forums.phpfreaks.com/topic/77514-solved-note-book-feature-problem-wont-show/#findComment-392741 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.