Page 1 of 1

unexpected T_CONSTANT_ENCAPSED_STRING

Posted: Tue Jun 22, 2004 9:34 am
by mattmcb
Sometimes another pair of eyes is the best solution. For some reason I can't diagnose these errors. I don't think PHP likes me very much. Anyways please help if you can...
Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in c:\program files\apache group\apache\storegroup\sg_forum\joint_venture_admin.php on line 48

Code: Select all

<?php
// MODE: EDIT
function edit_contract() {
// now to output the form HTML.
// Redirect to contract, CREATE MODE
	$user_id = $userdata['user_id'];
	$sql1 = 'SELECT `contract_id` , `user_id_1` , `user_id_2` , `user_id_3` , `user_id_4` , `venture_id` , `vdesc` , `status` , `post_date` '
        . ' FROM `venture_contract` '
        . ' WHERE user_id_1 = '.$user_id.' OR user_id_2 = '.$user_id.' OR user_id_3 = '.$user_id.' OR user_id_4 = '.$user_id.' ORDER BY post_date DESC'; 
	$result1 = mysql_query($sql1, $linkid) or die("Query failed: " . mysql_error($linkid));

	if(mysql_num_rows($result1) == 0){ 
   		echo("<br><center><span class='genmed'><font size='2' color='red'><b>You have NO Venture Contracts Created.</b></font></span></center>"); 
	}else{ 
        echo ("<br><table width='95%' cellpadding='2' cellspacing='1' border='0' class='forumline' align='center'><tr><th class='catleft' colspan='2' height='22' align='left'><img src='templates/phpib2/images/nav.gif'><span class='thCornerL'> EDIT CONTRACT MODE: Select a Venture Contract to EDIT</a></span></th></tr>
				<tr>
   					<td class='row1'>
					<span class='genmed'>");
	}

	// Display results for edit mode
	while ($row1 = mysql_fetch_array($result1))
	{    
***LINE 48***	echo ("<br><a href='http://www.storegroup.org/sg_forum/joint_venture_contract.php?mode=edit&user_id=".$user_id."&contract_id=".$row1['contract_id']."'>EDIT</a> Venture Type: ".$row1['venture_id']." Post Date:".$row1['post_date']." Contract Status: ".$row1['status']"<br>Venture Description: ".$row1['vdesc']"<br>Contract Participants: ");
		
		// Get usernames of contract participants
		$sql2 = 'SELECT username'
        . ' FROM `sgforum_users` '
        . ' WHERE user_id'
        . ' IN ( '.$row1['user_id_1'].','.$row1['user_id_2'].','.$row1['user_id_3'].','.$row1['user_id_4'].);
		$result2 = mysql_query($sql2, $linkid) or die("Query failed: " . mysql_error($linkid));
		while ($row2 = mysql_fetch_array($result2)) {
			echo ($row2['username'].", ");
		}
			echo ("<br><br>");
	}
			echo ("</span></td></tr></table>");
}

?>

Posted: Tue Jun 22, 2004 9:48 am
by redmonkey
Two errors...

Line 48 should be..

Code: Select all

echo ("<br><a href='http://www.storegroup.org/sg_forum/joint_venture_contract.php?mode=edit&user_id=".$user_id."&contract_id=".$row1['contract_id']."'>EDIT</a> Venture Type: ".$row1['venture_id']." Post Date:".$row1['post_date']." Contract Status: ".$row1['status']."<br>Venture Description: ".$row1['vdesc']."<br>Contract Participants: ");
Find the line...

Code: Select all

. ' IN ( '.$row1['user_id_1'].','.$row1['user_id_2'].','.$row1['user_id_3'].','.$row1['user_id_4'].);
And replace with...

Code: Select all

. ' IN ( '.$row1['user_id_1'].','.$row1['user_id_2'].','.$row1['user_id_3'].','.$row1['user_id_4'] . ')';