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 Quote Link to comment 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>"; } ?> Quote Link to comment 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.