Jump to content

[SOLVED] Need help with syntax


tqla

Recommended Posts

Hello. This is weird and I know it's something simple but I can't figure it out.

 

Look at the code below. I can see all of the variables from the 'echo' test, but the DB does not get populated. Does the DB part look right? I don't get DB errors so I know that it is connected, and the DB table name is correct.  ???

 

  		/* if data is good */


	 $firstName = $_POST['firstName'];
	 $lastName = $_POST['lastName'];
	 $title = $_POST['title'];
	 $company = $_POST['company'];
	 $street = $_POST['street'];
	 $city = $_POST['city'];
	 $state = $_POST['state'];
	 $zip = $_POST['zip'];
	 $telephone = $_POST['telephone'];
	 $email = $_POST['email'];
	 $annual_revenue = $_POST['annual_revenue'];
	 $mailboxes = $_POST['mailboxes'];
	 $email_app = $_POST['email_app']; 
	 $email_app_other = $_POST['email_app_other']; 
	 $future_app = $_POST['future_app'];
	 $future_app_other = $_POST['future_app_other'];
	 $archiving = $_POST['archiving'];
	 $email_satisfaction = $_POST['email_satisfaction'];
	 $interest = $_POST['interest'];


/* Test to see if variable took */

echo "$createDate,
$firstName,
$lastName,
$title,
$company, 
$street, 
$city,
$state, 
$zip, 
$telephone, 
$email,
$annual_revenue, 
$mailboxes, 
$email_app, 
$email_app_other, 
$future_app, 
$future_app_other, 
$archiving, 
$email_satisfaction, 
$interest,
";





$connection = mysql_connect($hostname_Auth, $username_Auth, $password_Auth) 
or die ("Couldn't connect to server.");
$db = mysql_select_db($database_Auth, $connection)
or die ("Couldn't select database."); 

      	$today = date("Y-m-d");
  	$date=time();   
	 $sql = "INSERT INTO survey 

	(createDate,
	firstName,
	lastName,
	title,
	company,
	street,
	city,
	state,
	zip,
	telephone,
	email,
	annual_revenue,
	mailboxes,
	email_app, 
	email_app_other, 
	future_app,
	future_app_other,
	archiving,
	email_satisfaction,
	interest) 

	VALUES

	('$today',
	'$firstName',
	'$lastName',
	'$title',
	'$company',
	'$street',
	'$city',
	'$state',
	'$zip',
	'$telephone',
	'$email',
	'$annual_revenue',
	'$mailboxes',
	'$email_app', 
	'$email_app_other', 
	'$future_app',
	'$future_app_other',
	'$archiving',
	'$email_satisfaction',
	'$interest')"; 



	echo "done"; 

	session_destroy();
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.