Forum Moderators: coopster
$sql = mysql_query("INSERT INTO customers ('client name', 'bill to address', 'shipping address', 'phone', 'contact name') VALUES ('$clientname', '$billtoaddress', '$shippingaddress', '$phone', '$contactname')");
This is the error message I receive when running the following script. Any ideas?
<?php
$clientname = $_POST['clientname'];
$contactname = $_POST['contactname'];
$phone = $_POST['phone'];
$shippingaddress = $_POST['shippingaddress'];
$billtoaddress = $_POST['billtoaddress'];
$sql1 = mysql_connect ("localhost", "username", "password") or die ('I cannot connect to the database because: ' . mysql_error());
$dbh = mysql_select_db ("database");
$sql = mysql_query("INSERT INTO customers ('client name', 'bill to address', 'shipping address', 'phone', 'contact name') VALUES ('$clientname', '$billtoaddress', '$shippingaddress', '$phone', '$contactname')") or die(mysql_error());
print $sql;
?>
$sql = mysql_query("INSERT INTO customers (`client name`, `bill to address`, `shipping address`, `phone`, `contact name`) VALUES ('$clientname', '$billtoaddress', '$shippingaddress', '$phone', '$contactname')");
Cheers
[dev.mysql.com...]
[dev.mysql.com...]