This script is working fine no errors come up but is not posting to database. can some one please help?
Yes, i have no password on mysql. not active yet. still in design and cant seem to get this thing to go
if($submit) {
$db = mysql_connect("localhost","root");
mysql_select_db("mydb",$db);
$sql= "INSERT INTO employees (first,last,address,position) VALUES ('$first','$last','$address','$position')";
$result=mysql_query($sql);
echo "Thank You! Information entered.\n";
}else{
?>
<form method="post" action="<?php echo $PHP_SELF?>">
First name:<input type="Text" name="first"><br>
Last name:<input type="Text" name="last"><br>
Address:<input type="Text" name="address"><br>
position:<input type="Text" name="position"><br>
<input type="Submit" name="submit" value="Enter information">
</form>
<?php
}
?>
Help! Please.
Moderator: General Moderators
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
Does it just continue to show you the form? If so, have you read:
Before Post Read: Concerning Passing Variables in PHP 4.2+
Mac
Before Post Read: Concerning Passing Variables in PHP 4.2+
Mac