Updating mysql data with php


02-Apr-2020 09:43

To update a record in any table it is required to locate that record by using a conditional clause.

Below example uses primary key to match a record in employee table.

This requires the use of multiple column = value expressions in UPDATE statement.Secondly, it needs to know which columns are to be updated, and the new values for those columns.Finally, it needs information about which specific rows are to be updated (controlled by the WHERE keyword).guido2004, I also tried updating my code with te code you supplied but I then get a HTTP 500 error screen Its really difficult though when I don't have anyone who can really show me the ropes.

I really appreciate your help UPDATE scrubs_tracker SET ref='2' , date_time='2010-06-03 ' , customer_name='Frediek' , customer_email_address='N/A' , case_number='2510308' , msisdn='741928755' , route_cause='Service Activations' , escalatedto='Scrubs' , province='' , comments='' WHERE ref='' mysql_query("UPDATE scrubs_tracker SET ref='$ud_ref' , date_time='$ud_date_time' , customer_name='$ud_customer_name' , customer_email_address='$ud_customer_email_address' , case_number='$ud_case_number' , msisdn='$ud_msisdn' , route_cause='$ud_route_cause' , escalatedto='$ud_escalatedto' , province='$ud_province' , comments='$ud_comments' , WHERE ref='$ref'"); $query = " UPDATE scrubs_tracker SET ref='$ud_ref' , date_time='$ud_date_time' , customer_name='$ud_customer_name' , customer_email_address='$ud_customer_email_address' , case_number='$ud_case_number' , msisdn='$ud_msisdn' , route_cause='$ud_route_cause' , escalatedto='$ud_escalatedto' , province='$ud_province' , comments='$ud_comments' , WHERE ref='$ref' "; mysql_query($query) or die('mysql error ' .

Once data has been added to a My SQL database table, it is invariably necessary to delete or update some or all of that data.