Jump to content

Database Insert ... can’t get it done


Recommended Posts

Hi,

I’ve checked 2 books and 3 web tutorials on this, but the data still wouldn’t add to my customer table ... who can give me a hint what’s wrong.

 

 

Here is the html form file

 

<html>

<body>

 

Fill out to insert to table "customer"<p>

 

<form name="form1" method="get"

action="newcustomer.php">

 

Name: <input type="text" name="name"><p>

Email address:

 

<input type="text" name="email"><p>

<input type="submit" name="Submit"

value="Submit">

</form>

 

</body>

</html>

 

 

 

 

Here is the process.php file

 

<html><title>Simple Insert ...</title>

<body>

 

<?php

 

$name = $_GET["name"];

$email = $_GET["email"];

$now = date("Y-m-d");

print "Name is $name<br>\n";

print "Email is $email<br>\n";

 

mysql_connect("localhost", "fhx", "dududu");

 

$result = mysql_query(

"insert into phpbase.customer

(name, email, signup, last_access) values

('$name', '$email', '$now', '$now')"

);

if ($result) {

print <<<EOT

Inserting successfull !

EOT;

}

else {

print "Inserting went wrong !";

}

 

mysql_close();

?>

</body></html>

 

 

 

 

 

This is my database

www.hfpz.net/support/php/database_01.jpg

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.