summaryrefslogtreecommitdiff
path: root/ext/sqlite
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2004-01-18 21:11:55 +0000
committerMarcus Boerger <helly@php.net>2004-01-18 21:11:55 +0000
commitc7c9c72d49f7ebe349af3410ccdc4ecda616da51 (patch)
treec82723ac8eab067d80b691b8b67fa803a14b8a4d /ext/sqlite
parent90515ee22af1be53b5a3e1b46bc1267c8768a11c (diff)
downloadphp-git-c7c9c72d49f7ebe349af3410ccdc4ecda616da51.tar.gz
Update, id_l is unique
Diffstat (limited to 'ext/sqlite')
-rwxr-xr-xext/sqlite/tests/sqlite_oo_031.phpt6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/sqlite/tests/sqlite_oo_031.phpt b/ext/sqlite/tests/sqlite_oo_031.phpt
index b2c1bffaf8..84e6861654 100755
--- a/ext/sqlite/tests/sqlite_oo_031.phpt
+++ b/ext/sqlite/tests/sqlite_oo_031.phpt
@@ -9,7 +9,7 @@ if (!extension_loaded("spl")) print "skip SPL is not present";
<?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 @@ class SqliteNestedset implements RecursiveIterator
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;
}