ayok Posted July 7, 2007 Share Posted July 7, 2007 Hi, I tried to make a guestbook with php, but I got this problem. I can put my messages to database, but when I want to show my message i only got this message. Guest's comments Name: Array [name] E-mail: Array Messages: Array [message] I use this script to show the message. <?php echo "<H3>Guest's comments</H3>"; include "guestbook_connection.php"; $show=mysql_query("SELECT * FROM guest ORDER BY guest_number DESC"); while ($data=mysql_fetch_array($show)) { echo "Name: $data [name]<br>"; echo "E-mail: $data [email]<br>"; echo "Message: $data [messages]<br>"; } ?> Could anybody help me out? thanks ayok Link to comment https://forums.phpfreaks.com/topic/58882-help-my-guestbook/ Share on other sites More sharing options...
pocobueno1388 Posted July 7, 2007 Share Posted July 7, 2007 Try changing your code to this: <?php echo "<H3>Guest's comments</H3>"; include "guestbook_connection.php"; $show=mysql_query("SELECT * FROM guest ORDER BY guest_number DESC"); while ($data=mysql_fetch_assoc($show)) { echo "Name: $data['name']<br>"; echo "E-mail: $data['email']<br>"; echo "Message: $data['messages']<br>"; } ?> Link to comment https://forums.phpfreaks.com/topic/58882-help-my-guestbook/#findComment-292159 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.