I had a PHP page where I was echoing out all the HTML. After being advised that is poor practice, and that I should write out the HTML and only switch to PHP when I need it, I am trying to rewrite my form to adhere to that.
I've tried the following, however the $row array which contains the results of my SQL query are not being called correctly,
<?php while($row = $sth->fetch()){ ?>
<p>
<input type = "hidden" name ="id" value="<?php $row["id"] ?>"/>';
<p>
<input type = "text" name ="firstName" size ="30" value=" <?php $row["firstName"]?>"/>';</p>
<p>
<input type = "text" name ="lastName" size ="30" value="<?php $row["lastName"]?>"/>';
</p>";
<input type="submit" value="Update" />';
<?php } ?>
From my understanding as long as the start and end brackets are still in the right order, the above code should work, however it does not.
What am I doing wrong?