angelacom3 Posted April 15, 2007 Share Posted April 15, 2007 Hey can anyone please help me. What i want to do is edit details that have been taken from mysql database and display them in a text box. I'm under standing what I’ve done so far which was to bring the job id code of the job that i want to edit from another page and i no the code to edit but what i can’t do is display the job data into a text box so it can be seen and edits can be made. All the books and website and forms I’ve read don’t show how to display the data to a text box or it’s so complicated that i don’t have a clue what’s going on??? Here the code that I have that so far. <?php if ( (isset($_GET['id'])) && (is_numeric ($_GET['id'])) ) { $id = $_GET['id']; } elseif ((isset($_POST['id'])) && (is_numeric($_POST['id'])) ) { $id = $_POST['id']; } else { echo 'Page Error. This page has been accessed in error.'; exit(); } require_once ('mysql_connect.php'); $query = "SELECT jobtitle FROM job_table WHERE jobid=$id"; $result = mysql_query($query); $row = mysql_fetch_array($result); ?> What I want to do next is to display the jobtitle to a text box so edits can be mad to it. Can anyone help me?? I’ve been trying different things for hours now and I’m on the verge or throwing the pc out the window. Link to comment https://forums.phpfreaks.com/topic/47099-editing-data/ Share on other sites More sharing options...
Barand Posted April 15, 2007 Share Posted April 15, 2007 <?php $result = mysql_query($query); $row = mysql_fetch_array($result); echo "<form action='somepage.php' method='post'>\n"; echo "<input type='text' name='jobtitle' value='{$row['jobtitle']}' size='40'><br />"; echo "<input type='submit' name='action' value='Submit'>"; echo "</form>\n"; ?> Link to comment https://forums.phpfreaks.com/topic/47099-editing-data/#findComment-229953 Share on other sites More sharing options...
angelacom3 Posted April 17, 2007 Author Share Posted April 17, 2007 Ah so simple!!! thank you so much. i was miles and miles in another direction. Link to comment https://forums.phpfreaks.com/topic/47099-editing-data/#findComment-231089 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.