Hi there,
The following code takes formdata (and one cookie, in the case of $totalcost) and shoves it into a MySQL database. The problem is it's not working, and I have no idea why.
Every time I run the script, I get the "die" message from the mysql_query statement, which only tells me things aren't working. I simply have NO idea what's wrong with this statement. From everything I can tell, the script has no problem connecting to the database, so that's not it... just this damned insert statement.
If someone could tell me what's causing the problem, I'd really, really appreciate it.
<connect to database server, select database, etc...>
$sql = "INSERT INTO orders (theorder, firstname, lastname, date, address1, address2, city, state, country, zip, phone, fax, email, cardnum, cardexp, howhear, howfind, totalcost) VALUES ('$theorder','$firstname','$lastname','$date','$address1','$address2','$city','$state','$country','$zip','$phone','$fax','$email','$cardnum','$cardexp','$howhear','$howfind','$totalcost')";
$result = mysql_query($sql)
or die("Error processing order. Sorry... $result");
PRINT("<center>Order processed!<br><br>$theorder</center>")