Help! Please.
Posted: Tue Sep 02, 2003 9:01 am
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
}
?>
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
}
?>