ballhogjoni Posted March 28, 2007 Share Posted March 28, 2007 I am having troubles entering this info into my db. Cna someone help? This is the error: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/realfina/public_html/ec/testdobaapi.php on line 22 <?php session_start(); $_SESSION['email'] = $_POST['email']; $_SESSION['nameoncc'] = $_POST['nameoncc']; $_SESSION['address'] = $_POST['address']; $_SESSION['city'] = $_POST['city']; $_SESSION['state'] = $_POST['state']; $_SESSION['zipcode'] = $_POST['zipcode']; $_SESSION['areacode'] = $_POST['areacode']; $_SESSION['prefix'] = $_POST['prefix']; $_SESSION['linenumber'] = $_POST['linenumber']; $_SESSION['Iagree'] = $_POST['Iagree']; ?> <?php $username="xxxx"; $password="xxxx"; $database="xxxx"; mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); $query = "INSERT INTO eBayoffers_info_1 VALUES ('','$_SESSION['email']','$_SESSION['nameoncc']','$_SESSION['address']','$_SESSION['city']','$_SESSION['state']','$_SESSION['zipcode']','$_SESSION['areacode']','$_SESSION['prefix']','$_SESSION['linenumber']','$_SESSION['Iagree']')"; mysql_query($query); mysql_close(); Link to comment https://forums.phpfreaks.com/topic/44688-solved-parse-error-syntax-error-unexpected-t_encapsed_and_whitespace-expecting-t_str/ Share on other sites More sharing options...
papaface Posted March 28, 2007 Share Posted March 28, 2007 these: $query = "INSERT INTO eBayoffers_info_1 VALUES ('','$_SESSION['email']', should be like this: $query = "INSERT INTO eBayoffers_info_1 VALUES ('','".$_SESSION['email']."', Link to comment https://forums.phpfreaks.com/topic/44688-solved-parse-error-syntax-error-unexpected-t_encapsed_and_whitespace-expecting-t_str/#findComment-217007 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.