Jump to content

Help my guestbook!


ayok

Recommended Posts

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.