danik69 Posted August 12, 2010 Share Posted August 12, 2010 Hi I am having a major problem with trying to get the HTML value attribute to display the a value stored in a array from SQL Query. So i have done an SQL query then outputted it all to the screen, but i cant set the value attribute on my HTML form to the variable $Name. Can anyone please tell me where i am going wrong? Thanks Nick while($nt=mysql_fetch_array($result)){ echo "$nt[photo_url] $nt[Name] $nt[Education] $nt[skills] $nt[Aboutme] <br>"; // name class and mark will be printed with one line break at the end } $Photo_url = $_POST["photo_url"]; $Name = $_POST["Name"]; $Education = $_POST["Education"]; $Skills= $_POST["Skills"]; $Aboutme = $_POST["Aboutme"]; ?> <form method="post" action="updateaboutme.php"> Photo Url:<input type="text" size="12" maxlength="12" name="Photo_url" value="<?php echo $nt['Name'] ?>" <br /> <input type="submit" value="submit" name="submit"> </form> Quote Link to comment Share on other sites More sharing options...
AbraCadaver Posted August 12, 2010 Share Posted August 12, 2010 Your missing the closing > on the input. Quote Link to comment Share on other sites More sharing options...
linus72982 Posted August 12, 2010 Share Posted August 12, 2010 You're also missing the closing semicolon in the php within the value attribute of the input tag. And I believe you should have quotes around the array keys in the second line. Also, not going to break anything, but you should use <br /> instead of <br> And of course, like the poster above said, you need to end your input tag with "/>" Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.