steves Posted November 8, 2006 Share Posted November 8, 2006 Ok so im trying to create a form, where the information is pulled from the database and displayed in the text fields. However, I would like to have the ability to change any data in those text fields, hit update and have it saved in the database. Here is the code I am working on to create the page that displays the text fields, however no data is being pulled from the database and is not showing up in these text fields. Any help is appreciated. I know right it will not actually update that data, i will work on that after this. I am just trying to get the data shown in the text fields of the form right now. Thank you. *Made these changes below and it now works*[code]$search = @$_GET['search'] ; SQL LOGIN HERE$query = "SELECT * FROM ads WHERE ad LIKE '$search' order by ad"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)){ $title = $row["ad"]; $title2 = $row["ad_type"]; $title3 = $row["resort_name"]; $title4 = $row["resort_location"]; $title5 = $row["week"]; $title6 = $row["bed"]; $title7 = $row["bath"]; } echo "<form action=updated.php method=post>Ad: <input type=text name=ad value=$title><br>Ad Type: <input type=text name=ad_type value=$title2><br>Resort Name: <input type=text name=resort_name value=$title3><br>Resort Location: <input type=text name=resort_location value=$title4><br>Week: <input type=text name=week value=$title5><br>Bed: <input type=text name=bed value=$title6><br>Bath: <input type=text name=bath value=$title7><br><input type=Submit value=Update></form> "; ?>[/code] 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.