NogDog wrote:Are you stuck with that array structure? It would be much easier (and logical) to add some dimensions to it so that you could more easily "walk" through it, such as with a foreach() loop. It might be something like:
$array = array(
'TableName_1' => array(
'value 1.1',
'value 1.2',
'value 1.3'
),
'TableName_2' => array(
'value 2.1',
'value 2.2',
'value 2.3'
)
);
Then you could just do:
foreach($array as $table => $values)
{
// do something with string $table and its array of $values
}
I'm not sure I understood that entirely :queasy:
I put my totalarray under. I need to put it out different table based on 'Tablename' (value beeing tables name) as one condition to seperate both the sql-statement and the tables.
array("Tablename => $_POST['tablename'], "Subject" => $_POST['tableSubject'], "Values"=> $_POST['tableValues']);
this would give med:
Array
(
[Tablename] => Array
(
[0] => aTableName
[1] => someOtherTableName
)
[Subject] => Array
(
[0] => someSub
[1] => someSub
[2] => someSub
[3] => someSub
)
[Values] => Array
(
[0] => some value
[1] => some value
[2] => some value
[3] => some value
)
)
but then again, maybe there is some better way around, just me not getting it..
Any suggestions..??