Wednesday, April 11, 2012

how to update existing date and insert new date in php MYSQL

hello i have little problem in updating date



my first table is



DONOR
donor-nic----username-----status
111----------ali----------available
222---------usman--------notavailable


my second table is



DONATION
donation_id------donor_nic-----date---
1----------------111----------2012/03/04
2---------------111-----------2012/06/07
3----------------111---------2012/07/08
4----------------222---------2012/03/03


now i am editing profile like
change date: 2012/07/07
change status: available/not available



i want to do that.. if donor that is editing profile/status.. select the date that already exists in donation table with his donor_nic then it will update his date..
if donor select new date that does not exist in donation table then it will insert this date..



anyone plz help me.. i dunt knw how to select all the dates of donor (111)
and then match this date from the new date.. plzz helpp mee





No comments:

Post a Comment