faqts : Computers : Programming : Languages : PHP

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

2 of 21 people (10%) answered Yes
Recently 2 of 10 people (20%) answered Yes


How to perform multiple records updates in PHP?

Jan 28th, 2007 22:53
Narendra Jain, ckb k,

e.g. If you want to update product weight for all unshipped orders, 
you can have a query as below to update multiple records:
update open_orders
set weight = 11.55
where product_id = "$required_product_id"
and ship_status = "open"
It depends on the database you are using, which will give you total 
number of records which will get updated using this query - a good way 
to display after the update is complete.