I am trying to call a record from a db so that I can amend it in a form. I keep getting the following message: Parse error: parse error in /chroot/home/TM340484/public_html/blog/editentry3.php on line 42 Line 42 is the end of my page. The variable is being passed to the receiving page, but I can't see what the error is in my code. I have pared the code to just two fields to try to narrow it down, but can't get it. I'm a beginner at this so could do with some help. <?php //queries the database using the variable value $amendarticle = mysql_query("SELECT * FROM article WHERE article_id='$article_id'" )or die(mysql_error()); //Tests that there is a result from the query(amendarticle) and outputs to screen while ($myrow = mysql_fetch_array($amendarticle)) { mysql_close(); ?> <form name="getentry" action="editentry.php" method="get" target="_self"> <input type="hidden" name="article_id" value="<? echo $myrow["article_id"]; ?>"><? echo $myrow["article_id"]; ?><br> <input type="text" name="article_title" size="60" maxlength="60" value="<? echo $myrow["article_title"]; ?>"><br> <input type="reset" value="Clear" name="reset"><br> <input type="submit" value="Submit" name="submit" ><br> </form> Code (markup): If anyone could help I would be grateful. I can't do the next bit until I can see that I can recall a record. Thanks for your help
If that's all of you code the first problem is you are not opening the first php tag, all you php sections should begin with <?php (<? will work but <?php is more obvious IMO)
Sorry, I missed the opening tag from the code posted, but it is there. Even when I changed the <? to <?php I still get the same problem. I am not familiar enough with php to see what is wrong. Any further ideas?
Thanks JRJR, I had just noticed it, then checked here to tell everyone, and you had already provided the answer. Thanks