cvs: php-src /ext/sqlite/tests sqlite_oo_031.phpt

From: Date: Sun, 18 Jan 2004 21:12:00 +0000
Subject: cvs: php-src /ext/sqlite/tests sqlite_oo_031.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-25732@lists.php.net to get a copy of this message
helly Sun Jan 18 16:12:00 2004 EDT Modified files: /php-src/ext/sqlite/tests sqlite_oo_031.phpt Log: Update, id_l is unique Index: php-src/ext/sqlite/tests/sqlite_oo_031.phpt diff -u php-src/ext/sqlite/tests/sqlite_oo_031.phpt:1.1 php-src/ext/sqlite/tests/sqlite_oo_031.phpt:1.2 --- php-src/ext/sqlite/tests/sqlite_oo_031.phpt:1.1 Sun Jan 18 15:57:42 2004 +++ php-src/ext/sqlite/tests/sqlite_oo_031.phpt Sun Jan 18 16:11:55 2004 @@ -9,7 +9,7 @@ <?php include "blankdb_oo.inc"; -$db->query("CREATE TABLE menu(id_l int, id_r int, key VARCHAR(10))"); +$db->query("CREATE TABLE menu(id_l int PRIMARY KEY, id_r int UNIQUE, key VARCHAR(10))"); $db->query("INSERT INTO menu VALUES( 1, 12, 'A')"); $db->query("INSERT INTO menu VALUES( 2, 9, 'B')"); $db->query("INSERT INTO menu VALUES(10, 11, 'F')"); @@ -56,11 +56,11 @@ protected $id_r; protected $entry; - function __construct($db, $id_l = 1, $id_r = 0) + function __construct($db, $id_l = 1) { $this->db = $db; $this->id_l = $id_l; - $this->id_r = $id_r ? $id_r : $this->db->single_query('SELECT max(id_r) FROM menu', 1); + $this->id_r = $this->db->single_query('SELECT id_r FROM menu WHERE id_l='.$id_l, 1); $this->id = $id_l; }

« previous php.cvs (#25732) next »