aaricwon Posted February 11, 2008 Share Posted February 11, 2008 I made this simple form: www.bjjnews.org/problems/form.html I made this page that will display the data entered by the form: www.bjjnews.org/problems/ Now I would like to update the database entries. All I really want to do is update the last column that says Status. Right now it says nothing BUT I would like to be able to put Complete or On Hold I know how to make a form that add's to a database BUT I don't know how to make a form that updates a current database record. Please help? Link to comment https://forums.phpfreaks.com/topic/90493-i-can-add-to-my-database-but-how-can-i-update-it/ Share on other sites More sharing options...
Aureole Posted February 11, 2008 Share Posted February 11, 2008 Ok? Link to comment https://forums.phpfreaks.com/topic/90493-i-can-add-to-my-database-but-how-can-i-update-it/#findComment-463957 Share on other sites More sharing options...
revraz Posted February 11, 2008 Share Posted February 11, 2008 Pass ??? Link to comment https://forums.phpfreaks.com/topic/90493-i-can-add-to-my-database-but-how-can-i-update-it/#findComment-463959 Share on other sites More sharing options...
aaricwon Posted February 11, 2008 Author Share Posted February 11, 2008 Sorry, I was trying to post but kept getting a blank page until I made the "Test" post... Link to comment https://forums.phpfreaks.com/topic/90493-i-can-add-to-my-database-but-how-can-i-update-it/#findComment-463960 Share on other sites More sharing options...
revraz Posted February 11, 2008 Share Posted February 11, 2008 Hyper links seem to be broken, so if you remove h t t p like you did, then it works. Link to comment https://forums.phpfreaks.com/topic/90493-i-can-add-to-my-database-but-how-can-i-update-it/#findComment-463961 Share on other sites More sharing options...
revraz Posted February 11, 2008 Share Posted February 11, 2008 Look at the updating section www.freewebmasterhelp.com/tutorials/phpmysql Link to comment https://forums.phpfreaks.com/topic/90493-i-can-add-to-my-database-but-how-can-i-update-it/#findComment-463963 Share on other sites More sharing options...
cedre Posted February 11, 2008 Share Posted February 11, 2008 If you use MySQL: dev.mysql.com/doc/refman/5.0/en/update.html If you use Oracle: www.psoug.org/reference/update.html Link to comment https://forums.phpfreaks.com/topic/90493-i-can-add-to-my-database-but-how-can-i-update-it/#findComment-463970 Share on other sites More sharing options...
aaricwon Posted February 11, 2008 Author Share Posted February 11, 2008 I'm not using Oracle for this. I really would like something as simple as this (because this is all I need). I would like to be able to type in the "Oracle Number" and then update the status on it. So basically if oracle order = 70003232 update status to: whatever i type in. I looked/went along with tutorials but for some reason can't seem to get it. I just want to type in a number to specify which record (that # would be field_1) and then want to be able to type to update field_7. Thank you guys. Everyone here is so good. I am sorry for annoying you with questions that I know are simple to you. Link to comment https://forums.phpfreaks.com/topic/90493-i-can-add-to-my-database-but-how-can-i-update-it/#findComment-463976 Share on other sites More sharing options...
revraz Posted February 11, 2008 Share Posted February 11, 2008 UPDATE table SET fieldname = '$newvalue' WHERE id = '$id'; Link to comment https://forums.phpfreaks.com/topic/90493-i-can-add-to-my-database-but-how-can-i-update-it/#findComment-463978 Share on other sites More sharing options...
aaricwon Posted February 11, 2008 Author Share Posted February 11, 2008 I have no idea what my problem is (besides being clueless) but I still am not getting it... -------------------------------------------- Here is my code for displaying the data: $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql'); $dbname = 'bjjnews_problemorders'; mysql_select_db($dbname); $query = "SELECT * FROM problems1 ORDER BY id DESC"; $result = mysql_query($query); echo "<table border='1'> <tr> <th>Oracle Order</th> <th>Customer</th> <th>Customer PO</th> <th>Problem</th> <th>Reported by</th> <th>Date</th> <th>Status</th> </tr>"; while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['field_1'] . "</td>"; echo "<td>" . $row['field_2'] . "</td>"; echo "<td>" . $row['field_3'] . "</td>"; echo "<td>" . $row['field_4'] . "</td>"; echo "<td>" . $row['field_5'] . "</td>"; echo "<td>" . $row['field_6'] . "</td>"; echo "<td>" . $row['field_7'] . "</td>"; echo "</tr>"; } echo "</table>"; ----------------------------------------------------------------------- All I want to do is be able to specify a database entry and update field_7 for that particular entry. Sorry I am so bad at this. I'm learning though. Link to comment https://forums.phpfreaks.com/topic/90493-i-can-add-to-my-database-but-how-can-i-update-it/#findComment-464009 Share on other sites More sharing options...
aaricwon Posted February 11, 2008 Author Share Posted February 11, 2008 ??? Link to comment https://forums.phpfreaks.com/topic/90493-i-can-add-to-my-database-but-how-can-i-update-it/#findComment-464050 Share on other sites More sharing options...
revraz Posted February 11, 2008 Share Posted February 11, 2008 I'm going to point you back to the Tutorial I posted earlier. If you take some time and follow each step, I think you'll figure it out. Link to comment https://forums.phpfreaks.com/topic/90493-i-can-add-to-my-database-but-how-can-i-update-it/#findComment-464051 Share on other sites More sharing options...
aaricwon Posted February 11, 2008 Author Share Posted February 11, 2008 Thanks. I will do that. I think I am overlooking something small but important. I have figured out how to delete records but not edit them. I think I am close :-) Next I REALLY want to learn to search Link to comment https://forums.phpfreaks.com/topic/90493-i-can-add-to-my-database-but-how-can-i-update-it/#findComment-464103 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.