Hi,
Have posted before, but will simplify problem here. For original post go to
I have setup 2 arrays like so in my one page script:
[PHP]
$carers = array(
array('names' => 'Carer 01', 'hours' => 8, 'remaining' => 8),
array('names' => 'Carer 02', 'hours' => 12, 'remaining' => 12),
array('names' => 'Carer 03', 'hours' => 6, 'remaining' => 6),
);
$clients = array(
array('names' => 'Client 01', 'hours' => 2),
array('names' => 'Client 02', 'hours' => 3),
array('names' => 'Client 03', 'hours' => 4),
array('names' => 'Client 04', 'hours' => 1),
array('names' => 'Client 05', 'hours' => 2),
array('names' => 'Client 06', 'hours' => 5),
);
[/PHP]
However, I want to actually retrive this data from a MySQL table. These
arrays are then processed further down the page. The DB looks similar to the
setup here: http://www.monkey-it.co.uk/db_schema.gif
As you can see, I have a DB called 'database' and two tables. Now, how would
I set the page up so that it would retrieve the data from the DB and use it
for processing further down the page like the above arrays would have
originally.
Many thanks,
Janusz
--
*************** *************** *************** ********
QOTSA: "Nicotine, Valium, Vicodin, Marijuana, Ecstacy and Alcohol"
Einstein: "Imaginatio n is More Important Than Knowledge"
Have posted before, but will simplify problem here. For original post go to
I have setup 2 arrays like so in my one page script:
[PHP]
$carers = array(
array('names' => 'Carer 01', 'hours' => 8, 'remaining' => 8),
array('names' => 'Carer 02', 'hours' => 12, 'remaining' => 12),
array('names' => 'Carer 03', 'hours' => 6, 'remaining' => 6),
);
$clients = array(
array('names' => 'Client 01', 'hours' => 2),
array('names' => 'Client 02', 'hours' => 3),
array('names' => 'Client 03', 'hours' => 4),
array('names' => 'Client 04', 'hours' => 1),
array('names' => 'Client 05', 'hours' => 2),
array('names' => 'Client 06', 'hours' => 5),
);
[/PHP]
However, I want to actually retrive this data from a MySQL table. These
arrays are then processed further down the page. The DB looks similar to the
setup here: http://www.monkey-it.co.uk/db_schema.gif
As you can see, I have a DB called 'database' and two tables. Now, how would
I set the page up so that it would retrieve the data from the DB and use it
for processing further down the page like the above arrays would have
originally.
Many thanks,
Janusz
--
*************** *************** *************** ********
QOTSA: "Nicotine, Valium, Vicodin, Marijuana, Ecstacy and Alcohol"
Einstein: "Imaginatio n is More Important Than Knowledge"
Comment