jeff5656 Posted December 1, 2008 Share Posted December 1, 2008 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 More sharing options...
dclamp Posted December 1, 2008 Share Posted December 1, 2008 the line above it is missing a semi-colon at the end Link to comment https://forums.phpfreaks.com/topic/134943-solved-parse-error-unexpected-t_echo/#findComment-702753 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.