lcy Posted August 27, 2009 Share Posted August 27, 2009 Gd morning! I have a table diplaying a list of data which is called from the database (based on selection made earlier). I use "while($row=my_sql_fetch_array($result)" to call all data for that table. Now, i need to update one of the data field of the table for the chosen row only. I use text field to display the data to make it editable. Then i create a button for each row to pass all needed data and the updated data to the following page where update takes place. However, the ediited value only for that chosen row cant be grabbed and be passed to the next page. How should i solve this? Thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/172063-urgent-need-help-to-update-a-field-in-php/ Share on other sites More sharing options...
Rommeo Posted August 27, 2009 Share Posted August 27, 2009 Can you post some codes ? from where you post the data ? where do you update the data ? Quote Link to comment https://forums.phpfreaks.com/topic/172063-urgent-need-help-to-update-a-field-in-php/#findComment-907238 Share on other sites More sharing options...
MadTechie Posted August 27, 2009 Share Posted August 27, 2009 ALSO when you signed up you accept the Term & Conditions Forum Guidelines 2. Users will not mark their post as being "URGENT" by either making the post ALL CAPS or adding any hint that they need it done Quick or ASAP. All posts are treated equal, your post is no more important than any other user's post on this forum. If it is "URGENT" pay someone to do it. Quote Link to comment https://forums.phpfreaks.com/topic/172063-urgent-need-help-to-update-a-field-in-php/#findComment-907247 Share on other sites More sharing options...
lcy Posted August 27, 2009 Author Share Posted August 27, 2009 This is my table: (table.php) <? while ($row9 = mysql_fetch_array($result9)) { ?> <td width="7%" bgcolor="#FFFFCC">Company</td> <td width="18%" bgcolor="#FFFFCC">NRIC</strong></td> <td width="44%" bgcolor="#FFFFCC">Name</td> <td width="11%" bgcolor="#FFFFCC">Validity</td> <td width="15%" bgcolor="#FFFFCC">Update Validity</td> <td><? echo "".$row12['company_code']."";?></td> <td><? echo "".$row9['NRIC']."-".$row9['NRIC1']."-".$row9['NRIC2']."";?></td> <td><? echo "".$row12['name']."";?></div></td> <td><input type="text" name="validity_new" value="<?php if ($row9['validity'] != NULL){echo $row9['validity'];}?>" size="1" maxlength="3"></td> <td><div align="center"><input type="image" name="update_validity" value="<? echo "".$row9['NRIC']."-".$row9['NRIC1']."-".$row9['NRIC2']."";?>" src="Pictures/4.png" alt="submit button" width="20" height="20"/></div></td> Once the "Update Validity" button is pushed, the data is passed to "update.php". $validity_new = $_POST['validity_new']; In "update.php", the value of updated validity for only the selected row cant be retrieved. Only if value for validity for all the row in the table are changed to a same value, the updated value can be retrieved in the update.php. I just want to update validity for the row selected. How can i do this? Thanks a lot. Quote Link to comment https://forums.phpfreaks.com/topic/172063-urgent-need-help-to-update-a-field-in-php/#findComment-907263 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.