cvs: pear /MDB2_Schema/docs/examples example.php
| From: | Helgi �ormar �orbj�rnsson | Date: | Tue, 16 Aug 2005 21:44:58 +0000 |
| Subject: | cvs: pear /MDB2_Schema/docs/examples example.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-34042@lists.php.net to get a copy of this message | ||
dufuz Tue Aug 16 17:44:58 2005 EDT
Modified files:
/pear/MDB2_Schema/docs/examples example.php
Log:
easier to add new databases to the example
http://cvs.php.net/diff.php/pear/MDB2_Schema/docs/examples/example.php?r1=1.7&r2=1.8&ty=u
Index: pear/MDB2_Schema/docs/examples/example.php
diff -u pear/MDB2_Schema/docs/examples/example.php:1.7
pear/MDB2_Schema/docs/examples/example.php:1.8
--- pear/MDB2_Schema/docs/examples/example.php:1.7 Tue Aug 16 17:32:44 2005
+++ pear/MDB2_Schema/docs/examples/example.php Tue Aug 16 17:44:57 2005
@@ -42,7 +42,7 @@
// | Author: Lukas Smith <smith@pooteeweet.org> |
// +----------------------------------------------------------------------+
//
-// $Id: example.php,v 1.7 2005/08/16 21:32:44 dufuz Exp $
+// $Id: example.php,v 1.8 2005/08/16 21:44:57 dufuz Exp $
//
/**
@@ -57,6 +57,13 @@
<html>
<body>
<?php
+$databases = array(
+ 'mysql' => 'MySQL',
+ 'mysqli' => 'MySQLi',
+ 'pgsql' => 'PostGreSQL',
+ 'sqlite' => 'SQLite',
+);
+
if (isset($_GET['submit']) && $_GET['file'] != '') {
require_once 'MDB2/Schema.php';
@include_once 'Var_Dump.php';
@@ -130,9 +137,15 @@
<form action="" method="get">
Database Type:
<select name="type">
- <option value="mysql"<?php if (isset($_GET['type']) &&
$_GET['type'] == 'mysql') {echo (' selected="selected"');}
?>>MySQL</option>
- <option value="pgsql"<?php if (isset($_GET['type']) &&
$_GET['type'] == 'pgsql') {echo (' selected="selected"');}
?>>PostGreSQL</option>
- <option value="sqlite"<?php if (isset($_GET['type']) &&
$_GET['type'] == 'sqlite') {echo (' selected="selected"');}
?>>SQLite</option>
+ <?php
+ foreach ($databases as $key => $name) {
+ echo ' <option value="' . $key . '"';
+ if (isset($_GET['type']) && $_GET['type'] == $key) {
+ echo ' selected="selected"';
+ }
+ echo '>' . $name . '</option>' . "\n";
+ }
+ ?>
</select>
<br />
Username: