Page 1 of 1

PHP Error

Posted: Mon Jun 21, 2004 3:27 pm
by mattmcb
Does anyone know what this error means:
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in c:\program files\apache group\apache\storegroup\sg_forum\joint_venture_contract.php on line 447
Here is the code:

Code: Select all

$sql = mysql_query("INSERT INTO venture_contract (user_id_1, month1, month2, month3, month4, month5, month6, month7, day1, day2, day3, day4, day5, day6, day7, year1, year2, year3, year4, year5, year6, year7, venture_id, vdesc, initial1, initial2, initia3, initial4, initial5, initial6, initial7, initial8, witness, esig1, esig2, esig3, esig4, notes, post_date) 
**LINE 447*** VALUES('$user_id', '".$_POST['month1']."', '".$_POST['month2']."', '".$_POST['month3']."', '".$_POST['month4']."', '".$_POST['month5']."', '".$_POST['month6']."', '".$_POST['month7']."', '".$_POST['day1']."', '".$_POST['day2']."', '".$_POST['day3']."', '".$_POST['day4']."', '".$_POST['day5']."', '".$_POST['day6']."', '".$_POST['day7']."', '".$_POST['year1']."', '".$_POST['year2']."', '".$_POST['year3']."', '".$_POST['year4']."', '".$_POST['year5']."', '".$_POST['year6']."', '".$_POST['year7']."', '".$_POST['venture_id']."', '".$_POST['vdesc']."', '".$_POST['initial1']."', '".$_POST['initial2']."', '".$_POST['initial3']."', '".$_POST['initial4']."', '".$_POST['initial5']."', '".$_POST['initial6']."', '".$_POST['initial7']."', '".$_POST['initial8']."', '".$_POST['witness']."', '".$_POST['esig1']."', '".$_POST['esig2']."', '".$_POST['esig3']."', '".$_POST['esig4']."', '".$_POST['notes']."', '$post_date')") or die (mysql_error());
	if(!$sql){
		echo 'There has been an error creating your Venture Contract. Please contact the <a href="mailto:webmaster@storegroup.org">webmaster</a>.';
	} else {
		echo '<center><br><span class="genmed"><font size="1" color="red"><b>You have successfully Created a Venture Contract!</b></font></span><br></center>';
		include($phpbb_root_path . 'venture/venture_html2.htm');
	}
I haven't seen this error before, any help would be appreciated.

Posted: Mon Jun 21, 2004 3:46 pm
by feyd
well.. syntax highlighting doesn't show anything.. uhm.. although your table structure seems overly complicated...

Posted: Mon Jun 21, 2004 4:05 pm
by mattmcb
It has to be overly complicated because it's for a contract. I can shorten it up if that would help. My guess is if I shorten it I can still duplicate the same error.

Posted: Mon Jun 21, 2004 11:59 pm
by Illusionist
it might be better if you change all the '".$_POST['whatever']."','" ..... and so on to something like: '{$_POST['whatever']}','{$_POST['anything']}' .... and so on I've always hated closing the " and concatenating and then opeing again like that....

just my .02

ANd in doing that it might solve your problem

Posted: Tue Jun 22, 2004 12:07 am
by kettle_drum
What happens if you put the sql statment all on one line?

Posted: Tue Jun 22, 2004 12:44 am
by Cateyes
Every time I get that error, on the line before it I usually forgot to put the semicolon to tell it I was starting a new line and god have I seen that error alot in the last 2 weeks since I started programming with PHP. I think that is your problem on this one.

Posted: Tue Jun 22, 2004 12:50 am
by Illusionist
No its not, because if you look where line 447 is, its right int he middle of his SQL statement...

Posted: Tue Jun 22, 2004 1:15 am
by kettle_drum
Its right where the statement is split into two lines which is the only thing that i can see which ould be slightly wrong.

Posted: Tue Jun 22, 2004 1:20 am
by Illusionist
Ahh your right kettle, i didn't bother to even check for that! lol i already thought everythign was on one line and it was just looking like that because of formating... o wait i think i might ahve found your problem!!!

try taking that **LINE 447*** out!! that looks out of place there!!:wink:

Posted: Tue Jun 22, 2004 1:25 am
by kettle_drum
lol. Congrats on 800!!!!

Posted: Tue Jun 22, 2004 1:38 am
by Illusionist
yay!! 1`// |\|0\\/ l337