/ Published in: PHP
URL: http://www.php.happycodings.com/Database_Related/code9.html
Expand |
Embed | Plain Text
<?php $dbname = "test"; $loginname = "user"; $loginpass = "password"; $dbhost = "localhost"; // store table names in an array $arr_tablenames[] = ''; // store number of fields per table(index 0,1,2..) in an array $arr_num_fields[] = ''; for ($i=0; $i < $num_tables; $i++) { $arr_num_fields[$i] = mysql_num_fields(mysql_db_query($dbname, "select * from $arr_tablenames[$i]", $id_link)); } // store field names in a multidimensional array: // [i] == table number, [ii] == field number for that table for ($i=0; $i < $num_tables; $i++) { for ($ii=0; $ii < $arr_num_fields[$i]; $ii++) { } } for ($i=0; $i < $num_tables; $i++) { for ($ii=0; $ii < $arr_num_fields[$i]; $ii++) { } for ($iii = 0; $iii < $number_of_rows; $iii++) { for ($ii=0; $ii < $arr_num_fields[$i]; $ii++) { } } } ?>
You need to login to post a comment.
