|
Posted by Richard Levasseur on 03/14/06 10:36
Its not, really, its in $table[$row][$col] = $value format, at least if
i understand his post correctly. It also sounds like an interation
problem? I can't rightly tell if its trouble getting the last key from
table ( $row from $table ) or last key from row ($col from each $row).
In either case:
$i = 0; to $i < n, iterates n times. Make sure you're iterating to the
correct amount
foreach($table as $row) {
$columns = implode(... array_keys($row));
$values = implode(... array_values($row));
$query = "insert into table ($columsn) values ($values)";
}
or
foreach($table as $row) {
"insert into table (col1, col2, ...) values ($row[level1], $row[level2]
....)";
}
Hope that helps?
Navigation:
[Reply to this message]
|