Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works

Adding details to my database

  • Please log in to reply




  • Member
  • PipPip
  • 40 posts

Im having a but of a nightmare here and need help before i breakdown :)

Ive made a simple web form on my site so customers can fill out there details, when the submit button is clicked a php script should send these details to my MySql database.

This isnt happening. Instead all i see in my phpMyadmin is "ARRAY | ARRAY | ARRAY" where the details should be?

This is my html form code:

<form method="post" action="sendform.php">
Your Name:<br />
<input type="text" name="name[]" /><br />
Email Address:<br />
<input type="text" name="email[]" /><br />
Your Product (graphics/tinting/printed clothing:<br />
<input type="text" name="product[]" /><br />
Short Description Of Product And Any Questions/Comments:<br />
<textarea name="message[]" rows="10" cols="40"></textarea><br />
<input name="Send it!" type="submit" id="Send it!" value="Send it!" />

This is the php script (sendform.php):


$user_name = "handy";
$password = "*****";
$database = "database2";
$server = "handygraphicscouk.ipagemysql.com";
$db_handle = mysql_connect($server, $user_name, $password);
$db_found = mysql_select_db($database, $db_handle);

if ($db_found) {

$SQL = "INSERT INTO Customers (name, email, product, message)
VALUES ('" .$name. "', '" .$email. "', '" .$product. "', '" .$message. "' )";
$result = mysql_query($SQL);


print "Records added to the database";
else {
print "Database NOT Found ";


I tested this by typing in "test" in each textbox on my web form and all i get returned is "Array" for each section?

I also would like the user to be re-directed back to a thankyou page but ill sort that out at a later date until this problem is solved?

If you need any more information let me know.

Any help or suggestions with this would be massivley welcomed. Please help!!

Many thanks

  • 0


Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP