I want to create a master-detail page using PHP. Rather than getting data from a MYSQL database, I want to get the data from an associative array. Is this possible?
The data will first be obtained from the mysql database table and stored inside an associative array for some processing. Now I want to create a master detail page based on the data inside the associative array alone. Anyone with Ideas?
It's just impossible, due to PHP nature.
PHP script being run for a fraction of second and then dies. With all it's variables and associative arrays and other stuff.
That's why a database intended to be data storage between distinct HTTP calls.
Thus, don't pretend to be a smartmass, let the things go natural way:
here is a very basic example of such application, using templates, to give you an idea:
details page template called form.php
and main page template called list.php
this is example of admin page, letting you add and edit records.
however, the page tat just shows the data will be pretty much the same.
If you are, for example, displaying a list of summary data and you want to dynamically show the details for a particular record, you can use javascript (jQuery is a nice library that makes dealing with javascript easier).
Depending on the number of records you display on your summary page, you can either
In neither case will you maintain all your data in memory.