diff options
author | Remi Collet <fedora@famillecollet.com> | 2010-08-07 18:32:09 +0200 |
---|---|---|
committer | Remi Collet <fedora@famillecollet.com> | 2010-08-07 18:32:09 +0200 |
commit | fe3d37364bbc072aedac951d4b2acc724ba7393a (patch) | |
tree | dc8dcc9ec2f864962dba5c59f46289659861495e /testdb.php | |
parent | 6d2954c5e9da8cd36c231114df5184d4a3101ddd (diff) |
add Class TableRpmRepo and use it everywhere
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)); +?> |