note 97820 added to book.mssql
| From: | Anonymous at osu1 dot php dot net | Date: | Mon, 10 May 2010 14:43:19 +0000 |
| Subject: | note 97820 added to book.mssql | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-169122@lists.php.net to get a copy of this message | ||
Better use this version to get all columns in the right order
<?php
$all = MSSQL_Query("select TABLE_NAME, COLUMN_NAME from INFORMATION_SCHEMA.COLUMNS order by
TABLE_NAME, ORDINAL_POSITION");
$tables = array();
$columns = array();
while($fet_tbl = MSSQL_Fetch_Assoc($all)) { // PUSH ALL TABLES AND COLUMNS INTO THE ARRAY
$tables[] = $fet_tbl[TABLE_NAME];
$columns[] = $fet_tbl[COLUMN_NAME];
}
$sltml = array_count_values($tables); // HOW MANY COLUMNS ARE IN THE TABLE
$i2=0;
foreach($sltml as $table_name => $id) {
echo "<h2>". $table_name ." (". $id .")</h2><ol>";
for($i = 0; $i <= $id-1; $i++) {
echo "<li>". $columns[$i2] ."</li>";
$i2++;
}
echo"</ol>";
}
?>
----
Server IP: 69.147.83.197
Probable Submitter: 93.193.208.122
----
Manual Page -- http://www.php.net/manual/en/book.mssql.php
Edit -- https://master.php.net/note/edit/97820
Del: integrated -- https://master.php.net/note/delete/97820/integrated
Del: useless -- https://master.php.net/note/delete/97820/useless
Del: bad code -- https://master.php.net/note/delete/97820/bad+code
Del: spam -- https://master.php.net/note/delete/97820/spam
Del: non-english -- https://master.php.net/note/delete/97820/non-english
Del: in docs -- https://master.php.net/note/delete/97820/in+docs
Del: other reasons-- https://master.php.net/note/delete/97820
Reject -- https://master.php.net/note/reject/97820
Search -- https://master.php.net/manage/user-notes.php