writing to a database
i have a database called customers. i want to create a form which passes the data into the customer database.
i think below is the correct code for sending the data. but where do i place this code on my form.
thanks in advance
<?php
/* Connecting, selecting database */
$link = mysql_connect("localhost", "233560", "233560")
or die("Could not connect : " . mysql_error());
mysql_select_db("db_233560") or die("Could not select database");
// Input info to table
$query = "INSERT INTO customers VALUES('" . $pagefrom . "','" . $first_name . "','" . $last_name . "','" . $delivery_address . "','" . $billing_address . "','" . $purchase_quantity . "','" . $comments . "')";
print $query; //Copy and execute the query in MYSQL db, that resulted
//in the above print and see if that inserts data
//successfully.
//Close db
mysql_close($link);
?>
|