Jump to content

[SOLVED] parse error, unexpected T_ECHO


jeff5656

Recommended Posts

I'm tring to echo an <input> form inside an array.  I get this error Parse error: parse error, unexpected T_ECHO, expecting ',' or ';' in /home/content/j/e/f/jeff/html/schedules/edit-test.php on line 42

 

The line in question is:

	 echo "<input name='".$row[$varArray[$i] . $f]."' type='text' size='13' value= '".$row[$varArray[$i] . $f]."'; />";

Here is the full code. Any ideas?

 

 

 

$consultsq1 = "SELECT * FROM `staffsched` WHERE `which_month`='".$curr_month."'";
$result = mysql_query ($consultsq1) or die ("Invalid query: " . mysql_error ());
$row = mysql_fetch_array ($result);

echo "<table border='1'  border='1' cellpadding='0' width='100%'>";
echo "<th width='2%'>Date</th><th>ICU Fellow</th><th>ICU Staff</th><th>F2 Staff</th><th>Intervention</th><th>West Bloomfield</th><th>Transplant</th><th>Pulm HTN</th><th>Warren Days</th><th>Warren Nights (5p-8a)</th>";

echo "<form action='commit.php' method='post'>";
echo "<tr><td ><table >";
$varArray = array("which_date");
$varArraySize = count($varArray);

for ($i = 0; $i < $varArraySize;$i++) {

   for ($f = 1; $f < 32; $f++) {
     

 echo "<td style='border-bottom-style: solid;'> " 
 echo "<input name='".$row[$varArray[$i] . $f]."' type='text' size='13' value= '".$row[$varArray[$i] . $f]."'; />";
 echo "</td>";
 echo "<tr>";
   }
   

}
echo "</table></td>";

Link to comment
https://forums.phpfreaks.com/topic/134943-solved-parse-error-unexpected-t_echo/
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.