PHP Error

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mattmcb
Forum Commoner
Posts: 27
Joined: Sun Jan 25, 2004 3:34 pm

PHP Error

Post 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.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

well.. syntax highlighting doesn't show anything.. uhm.. although your table structure seems overly complicated...
mattmcb
Forum Commoner
Posts: 27
Joined: Sun Jan 25, 2004 3:34 pm

Post 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.
Illusionist
Forum Regular
Posts: 903
Joined: Mon Jan 12, 2004 9:32 pm

Post 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
kettle_drum
DevNet Resident
Posts: 1150
Joined: Sun Jul 20, 2003 9:25 pm
Location: West Yorkshire, England

Post by kettle_drum »

What happens if you put the sql statment all on one line?
Cateyes
Forum Commoner
Posts: 63
Joined: Mon Jun 14, 2004 5:06 pm

Post 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.
Illusionist
Forum Regular
Posts: 903
Joined: Mon Jan 12, 2004 9:32 pm

Post by Illusionist »

No its not, because if you look where line 447 is, its right int he middle of his SQL statement...
kettle_drum
DevNet Resident
Posts: 1150
Joined: Sun Jul 20, 2003 9:25 pm
Location: West Yorkshire, England

Post 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.
Illusionist
Forum Regular
Posts: 903
Joined: Mon Jan 12, 2004 9:32 pm

Post 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:
kettle_drum
DevNet Resident
Posts: 1150
Joined: Sun Jul 20, 2003 9:25 pm
Location: West Yorkshire, England

Post by kettle_drum »

lol. Congrats on 800!!!!
Illusionist
Forum Regular
Posts: 903
Joined: Mon Jan 12, 2004 9:32 pm

Post by Illusionist »

yay!! 1`// |\|0\\/ l337
Post Reply