i want to show age of each person in table based on birthday, as well as export as a cv
i think i need php but i confused
that works perfectly thanks but how can ı export this
i use another db read to export data
if i put age there model.age couldnt find error
Well no of course not. Like I said to export it to CSV you need to either:
1) Read data, then use PHP to loop through and add an "age" field to each row of the array, then use the array you return from the PHP block as the data source for your CSV export action
or
2) Get the age as part of the data read itself. http://www.gizmola.com/blog/archives/archives/107-Calculate-a-persons-age-in-a-MySQL-query.html
OR THERE IS AN OPTION 3!!!
DON'T export the age at all! Because as soon as you export it the age becomes potentially incorrect anyway. Just recalculate the age wherever it is you're using the CSV.