Hi There,
I am currently adding a purchase history section to payment system, the system is built in PHP (codeigniter framework) and mysql. The idea of the payment history section is that all the customer purchases are grouped together by date, so in the end the HTML would look similar to this,
My question is I can get the data out of the database no problem, but how can i loop through it so that I show the date of the purchases and then purchases relevent to that date and so on and so forth.
EDIT - A PRINT OUT OF THE ARRAY THAT IS RETURNED FROM THE DB SORRY FOR THE SIZE
Array
(
[0] => Array
(
[id] =>
[employer_id] => 1
[cv_id] =>
[transaction_id] => -1402310
[date_created] => 20-07-10
[date_updated] =>
[code] => 849711492
[status] => SHOW
[is_complete] => TRUE
[job_status] => 1
[dob] =>
[will_relocate] => Y
[education_level] => HIGH_SCHOOL
[job_looking_for] =>
[keywords_education] => Halifax University
[keywords_employment] => senior applications developer
[self_description] =>
[looking_for] => Lorem ipsum
[sector_id_csv] => 10,23,14,6,3
[key_skills_csv] =>
[expected_salary_level] => LEVEL_6
[expected_salary_low] => 0
[expected_salary_high] => 0
[best_salary_low] => 0
[best_salary_high] => 0
[last_job_salary_low] =>
[last_job_salary_high] =>
[last_job_title_1] => Designer
[last_job_title_2] =>
[last_job_employer_1] => BT
[last_job_employer_2] =>
[qual_highest_level] => 0
[is_grad] => Y
[is_contract] => N
[is_temporary] => Y
[is_permanent] => Y
[is_full_time] => Y
[is_part_time] => Y
[logitude] =>
[latitude] =>
[city] =>
[area] =>
[sign_up_stages_completed] =>
[sign_up_last_stage_completed] =>
[sign_up_complete] =>
[email_authenticated] =>
[email] =>
[email_contact] =>
[phone_contact_number] =>
[password] =>
[firstname] =>
[surname] =>
[address_1] =>
[address_2] =>
[address_3] =>
[postcode] =>
[country] =>
)
[1] => Array
(
[id] =>
[employer_id] => 1
[cv_id] =>
[transaction_id] => -1402310
[date_created] => 20-07-10
[date_updated] =>
[code] => 849719383
[status] => SHOW
[is_complete] => TRUE
[job_status] => 1
[dob] =>
[will_relocate] => Y
[education_level] => HIGH_SCHOOL
[job_looking_for] =>
[keywords_education] => Crewe Art School
[keywords_employment] => senior applications developer
[self_description] =>
[looking_for] => Lorem ipsum
[sector_id_csv] => 13,24,7,17,5
[key_skills_csv] =>
[expected_salary_level] => LEVEL_6
[expected_salary_low] => 0
[expected_salary_high] => 0
[best_salary_low] => 0
[best_salary_high] => 0
[last_job_salary_low] =>
[last_job_salary_high] =>
[last_job_title_1] => Developer
[last_job_title_2] =>
[last_job_employer_1] => Orange
[last_job_employer_2] =>
[qual_highest_level] => 0
[is_grad] => Y
[is_contract] => N
[is_temporary] => Y
[is_permanent] => Y
[is_full_time] => Y
[is_part_time] => N
[logitude] =>
[latitude] =>
[city] =>
[area] =>
[sign_up_stages_completed] =>
[sign_up_last_stage_completed] =>
[sign_up_complete] =>
[email_authenticated] =>
[email] =>
[email_contact] =>
[phone_contact_number] =>
[password] =>
[firstname] =>
[surname] =>
[address_1] =>
[address_2] =>
[address_3] =>
[postcode] =>
[country] =>
)
[2] => Array
(
[id] =>
[employer_id] => 1
[cv_id] =>
[transaction_id] => 23-9-1402338
[date_created] => 17-07-10
[date_updated] =>
[code] => 849711492
[status] => SHOW
[is_complete] => TRUE
[job_status] => 1
[dob] =>
[will_relocate] => Y
[education_level] => HIGH_SCHOOL
[job_looking_for] =>
[keywords_education] => Halifax University
[keywords_employment] => senior applications developer
[self_description] =>
[looking_for] => Lorem ipsum
[sector_id_csv] => 10,23,14,6,3
[key_skills_csv] =>
[expected_salary_level] => LEVEL_6
[expected_salary_low] => 0
[expected_salary_high] => 0
[best_salary_low] => 0
[best_salary_high] => 0
[last_job_salary_low] =>
[last_job_salary_high] =>
[last_job_title_1] => Designer
[last_job_title_2] =>
[last_job_employer_1] => BT
[last_job_employer_2] =>
[qual_highest_level] => 0
[is_grad] => Y
[is_contract] => N
[is_temporary] => Y
[is_permanent] => Y
[is_full_time] => Y
[is_part_time] => Y
[logitude] =>
[latitude] =>
[city] =>
[area] =>
[sign_up_stages_completed] =>
[sign_up_last_stage_completed] =>
[sign_up_complete] =>
[email_authenticated] =>
[email] =>
[email_contact] =>
[phone_contact_number] =>
[password] =>
[firstname] =>
[surname] =>
[address_1] =>
[address_2] =>
[address_3] =>
[postcode] =>
[country] =>
)
[3] => Array
(
[id] =>
[employer_id] => 1
[cv_id] =>
[transaction_id] => 23-9-1402338
[date_created] => 17-07-10
[date_updated] =>
[code] => 849719383
[status] => SHOW
[is_complete] => TRUE
[job_status] => 1
[dob] =>
[will_relocate] => Y
[education_level] => HIGH_SCHOOL
[job_looking_for] =>
[keywords_education] => Crewe Art School
[keywords_employment] => senior applications developer
[self_description] =>
[looking_for] => Lorem ipsum
[sector_id_csv] => 13,24,7,17,5
[key_skills_csv] =>
[expected_salary_level] => LEVEL_6
[expected_salary_low] => 0
[expected_salary_high] => 0
[best_salary_low] => 0
[best_salary_high] => 0
[last_job_salary_low] =>
[last_job_salary_high] =>
[last_job_title_1] => Developer
[last_job_title_2] =>
[last_job_employer_1] => Orange
[last_job_employer_2] =>
[qual_highest_level] => 0
[is_grad] => Y
[is_contract] => N
[is_temporary] => Y
[is_permanent] => Y
[is_full_time] => Y
[is_part_time] => N
[logitude] =>
[latitude] =>
[city] =>
[area] =>
[sign_up_stages_completed] =>
[sign_up_last_stage_completed] =>
[sign_up_complete] =>
[email_authenticated] =>
[email] =>
[email_contact] =>
[phone_contact_number] =>
[password] =>
[firstname] =>
[surname] =>
[address_1] =>
[address_2] =>
[address_3] =>
[postcode] =>
[country] =>
)
)
Basically Every Time there is a new data I need to list the contents of the array under it, and if two arrays have the same data list them just under one data something like,
30-07-10
Result 1
2
3
28-7-10
4
5