diff options
Diffstat (limited to 'testdb.php')
-rw-r--r-- | testdb.php | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/testdb.php b/testdb.php new file mode 100644 index 0000000..3454245 --- /dev/null +++ b/testdb.php @@ -0,0 +1,38 @@ +<?php +require "include/main.php"; +require "class/CommonTable.php"; + +$db = new PDO ("mysql:dbname=" . MYBASE . ";host=" . MYHOST, MYUSER, MYPASS); + +$pear = new TableRRepo($db); +print_r($pear->getAllRepo()); + +echo "PEAR\n"; + +$pear = new TablePearRepo($db); +print_r($pear->getAllRepo()); + +$pear = new TablePearRepo($db); +print_r($pear->getAllRepo(false)); + +$a=$pear->add(array('alias'=>'test', 'url'=>'testurl')); +echo "Ajout : $a\n"; + +$b=$pear->delete(array('id'=>$a)); +echo "Del : $b\n"; + +echo "RPM:"; +$rpm = new TableRpmRepo($db); + +if ($rpm->update(999, array('stamp'=>1))) +{ + echo "Update 1 ok\n"; +} +print_r($rpm->getAllRepo()); +if ($rpm->update(999, array('stamp'=>2))) +{ + echo "Update 2 ok\n"; +} +$all = $rpm->getAllRepo(); +print_r(array_pop($all)); +?> |