Page 1 of 1

Help! Please.

Posted: Tue Sep 02, 2003 9:01 am
by jlinderman
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

}

?>

Posted: Tue Sep 02, 2003 9:08 am
by twigletmac
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

thanks!

Posted: Tue Sep 02, 2003 9:56 am
by jlinderman
Helped a million