First Commit
This commit is contained in:
1 parent
5eb9dd037d
commit
2e62c0e60b
11877 files changed
+2035312
No files matched your search
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
include "db.php";
|
||||
|
||||
$tableName = "schools";
|
||||
if ($argc > 1) $tableName = $argv[1];
|
||||
else {
|
||||
$table = readline("Table (schools): ");
|
||||
if (strlen(trim($table))) $tableName = $table;
|
||||
}
|
||||
|
||||
$arrayName = readline("Array ($tableName): ");
|
||||
if (strlen($arrayName) == 0) $arrayName = $tableName;
|
||||
|
||||
|
||||
echo("\n");
|
||||
echo("\$$arrayName = array();\n");
|
||||
|
||||
$query = "SHOW columns FROM $tableName";
|
||||
$results = db_query($query);
|
||||
|
||||
while ($row = db_fetch_assoc($results)) {
|
||||
$field = $row['Field'];
|
||||
echo('if (isset($' . $field . ')) $' . $arrayName . "['" . $field . "'] = $" . $field . ";\n");
|
||||
}
|
||||
|
||||
echo("\n");
|
||||
|
||||
?>
|
||||
Reference in new issue
Block a user