Posting to a database
| From: | Brent Lee | Date: | Sun, 04 May 2003 15:53:50 +0000 |
| Subject: | Posting to a database | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-146362@lists.php.net to get a copy of this message | ||
Hi all, I'm new to all this. could someone tell me why this script doesn't
post to my Database?
<HTML>
<?php
if($submit)
{
$db = mysql_connect("localhost", "XXXXXX","xxxxxxxx");
mysql_select_db("xxxxxxxx",$db);
$sql = "INSERT INTO current (Company, Start, Description, DWSRep)
VALUES ('$company','$start','$description', '$rep',)";
$result = mysql_query($sql);
echo "PIP Information Updated.";
}
else
{
?>
<form method="post" action="data_input.php">
Customer name:<input type="Text" name="company"><br>
Start Date: <input type="Text" name="start"><br>
Project Description: <input type="Text" name="description"><br>
DWS Representative: <input type="Text" name="rep"><br>
<input type="Submit" name="submit" value="Update
PIP"></form>
<?
}
?>
</HTML>
I get the "PIP Information updated" message back but when i view the
Database there is no new information in it.
I'm reading as fast as I can but having someone to ask questions is very
helpfull.
--
Thanks all.