View Full Version : error in code

02-21-2007, 11:03 PM
I have a form that lets people sign up for my services, then it gets inserted into a MYSQL database. The person fills out the form thens submits, but there is an error on the form action page. On line 50
Here is the code.



@mysql_select_db($database) or die( "Unable to select database");

$query= "INSERT INTO contacts VALUES('','$first','$last','$email','$phone','$mobile','$address','$city','$state','$zip')";

echo("Thank you for signing up. You will recieve an email when your submision is reviewed.")

mysql_close() <---line 50

the form is at http://www.surfacehawaii.com/kylecaleb/packages/signup.php

02-21-2007, 11:04 PM
you're missing a ; on the previous line.

In future, including the error message will help people help you...

02-21-2007, 11:13 PM
Not only that, you need a ; after mysql_close() as well.

02-21-2007, 11:25 PM
thanks lol

02-21-2007, 11:32 PM
Not only that, you need a ; after mysql_close() as well.

I'll be honest and say I did miss that one, but the last line of code doesn't actually need a ; for things to work. I wouldn't reccomend doing it intentionally though, it's likely to lead to headaches should you come back and add more lines

02-21-2007, 11:51 PM
new problem
now it is: Parse error: parse error, unexpected T_STRING in /homepages/0/d176381271/htdocs/kylecaleb/packages/insert.php on line 43

Line 43 is

I am getting confused

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum