$query="SELECT sub_name,freetut_id FROM freetutorials"; $result = mysql_query ($query); echo "<select name='subject' value=''>Subjects</option>"; // printing the list box select command
while($nt=mysql_fetch_array($result)){//Array or records stored in $nt echo "<option value=$nt[freetut_id]>$nt[sub_name]</option>"; /* Option values are added by looping through the array */ } echo "</select>";// Closing of list box ?> </li>
// Insert data into mysql $query = "INSERT INTO homeworkask (dueon, problems, subject) " . " VALUES ('$dueon','$problems', '$subject' )";
."','" .$concatdate
$result = mysql_query($query) or die('Unable to add product'); if ($result) echo "<h2>Your Homework has been Submitted. Check your email in about 24 hours.</h2>\n"; else echo "<h2>Problem Submitting your Homework.</h2>\n"; echo"<a href='index.php'>Back to main page</a>";
}
// close connection mysql_close(); ?>
But this is the error I have Parse error: syntax error, unexpected T_VARIABLE in C: on line 143.. Thanks for your Help
hi,
neither of the two files you included has 143 lines of code, therefore i'm guessing the problem lies elsewhere. please see what file is mentioned where it says the error is on line 143.