Solution DMB Posted May 28, 2022 Solution Share Posted May 28, 2022 The list of person info is showing HTML tabular format, for which the code have attached (file name is admin.php line number 338-377). For this script output is displaying properly. But the functionality is whenever we will click the tick mark (which is in line number 370-372), at that moment it should update the table, for which the script appr.php is attached. But it's not updating the table. Could you please help me to update the data in table. admin.txt appr.txt Quote Link to comment https://forums.phpfreaks.com/topic/314851-unable-to-update-data-for-a-column-in-mysql-table/ Share on other sites More sharing options...
mac_gyver Posted May 28, 2022 Share Posted May 28, 2022 14 minutes ago, DMB said: click the tick mark does the browser goto appr.php with a valid id=xxx on the end of the url? btw - you should be using a post method form when performing an action on the server. also, when learning, developing, and debugging code/query(ies), you should display all php errors. error_reporting should always be set to E_ALL and display_errors should be set to ON, preferably in the php.ini on your system. by setting error_reporting to zero in your code, php won't help you find problems that it detects. you should always have error handling for statements that can fail. for database statement that can fail - connection, query, prepare, and execute, the simplest way of adding error handling, without adding code at each statement, is to use exceptions for errors and in most cases let php catch the exception, where php will use its error related settings (see the above paragraph) to control what happens with the actual error information (database statement errors will 'automatically' get displayed/logged the same as php errors.) to enable exceptions for errors for the mysqli extension, add the following line of code before the point where you make the database connection - mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT); next, you should always trim, then validate inputs before using them. if a required input doesn't exist, that's an error and you should setup a message for the user and not attempt to run any code that must have the input. you should not put external, unknown, dynamic values directly into an sql query statement. use a prepared query instead. you would also want to switch to the much simpler PDO database extension. ids in the html document must be unique. if you are not using any particular id at all, simply leave it out of the markup. you should validate your html markup at validator.w3.org 1 Quote Link to comment https://forums.phpfreaks.com/topic/314851-unable-to-update-data-for-a-column-in-mysql-table/#findComment-1596751 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.