Help! Please.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
jlinderman
Forum Newbie
Posts: 5
Joined: Tue Sep 02, 2003 9:01 am

Help! Please.

Post 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

}

?>
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post 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
User avatar
jlinderman
Forum Newbie
Posts: 5
Joined: Tue Sep 02, 2003 9:01 am

thanks!

Post by jlinderman »

Helped a million
Post Reply