Wont create data in my tables.
| From: | Morten Nielsen | Date: | Sat, 19 Apr 2003 11:27:43 +0000 |
| Subject: | Wont create data in my tables. | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-19496@lists.php.net to get a copy of this message | ||
Hi everybody
I'm following the book called "MySQL / PHP Database Applications",
i'm trying to write the Guestbook application.
The problem is with creating data in the tables.
Can anybody tell me if this code is correct or not ?.
<?php
include("dbconnect.php");
?>
<?php
if ($submit =="Sign!")
{
$query = "insert into guestbook (name,location,email,url,comments)
values ('$name', '$location', '$email', '$url',
'$comments')";
mysql_query($query) or
die (mysql_error())
?>
<h2>Thanks</h2>
<h2> <a href="view.php">View My Guestbook</a></h2>
<?php
}
else
{
include ("guestbook.php");
}
?>
The code in dbconnect.php is working as i can view the data in the database with view.php, if i
creat them manualy.
Thanks for any help i can get.
Regards
Morten