it makes it much easier to read the code if you use the [php] and [/php] tags around your code like you're supposed to:
<?php
$link = mysql_connect("localhost", "user", "pass");
mysql_select_db ("db") ;
echo $fname;
echo $sname;
echo $address;
echo $postcode;
echo $telephone;
echo $email;
echo $ccard;
$sql = mysql_query("INSERT INTO customer (cust_fname, cust_sname, cust_address, cust_postcode, cust_tel, cust_email, cust_cc)
VALUES('$fname', '$sname', '$address', '$postcode', '$telephone', '$email', '$ccard' ");
if(!$sql){
echo 'There has been an error creating your account. Please contact the webmaster.';
} else {
echo 'information added';
}
?>
<html>
</html>
You're missing a closing bracket on the SQL line:
$sql = mysql_query
(
"INSERT INTO customer
(
cust_fname, cust_sname, cust_address, cust_postcode, cust_tel, cust_email, cust_cc
)
VALUES
(
'$fname', '$sname', '$address', '$postcode', '$telephone', '$email', '$ccard' "
);
I've split it up so you can see more easily - you start with the parenthesis after the query, then you open and close another for the cell names, then you open another for the values, but you dont close it - you go straight into the closing ") for the function.
It's always a good idea to define your SQL statement ($sql) and then run the query in another step (ie $result = mysql_query($sql)). That way you can echo out your sql (echo $sql) to see what's gone wrong with it.