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
https://forums.phpfreaks.com/topic/81096-solved-need-help-with-syntax/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.