From be3a6b951626353c15c7d696aeb1c4b4e47f0f3a Mon Sep 17 00:00:00 2001 From: Horus3 Date: Sun, 23 Feb 2014 01:21:41 +0100 Subject: still messing with recursion --- www/select.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/www/select.php b/www/select.php index 8ad111e..1dda9cf 100644 --- a/www/select.php +++ b/www/select.php @@ -5,14 +5,26 @@ $db = new SQLite3("../database/sqlite.db"); $user=2; $parent=1; +$result_db = $db->query("SELECT id, parent, name, share FROM files WHERE parent=$parentdir AND owner=$owner AND folder='DIRECTORY' AND share='PUBLIC';"); +while(!empty($result=$result_db->fetchArray())){ + $dimension = count($result); + for($i=0;$i<$dimension;$i++){ + echo $result[$i][2]; + $parentdir=$result[$i][0]; + $result_db = $db->query("SELECT id, parent, name, share FROM files WHERE parent=$parentdir AND owner=$owner AND folder='DIRECTORY' AND share='PUBLIC';"); + $result=$result_db->fetchArray(); + } +} + +/* function select_db ($db, $owner, $parentdir){ $result_db = $db->query("SELECT id, parent, name, share FROM files WHERE parent=$parentdir AND owner=$owner AND folder='DIRECTORY' AND share='PUBLIC';"); $count=0; while ($result = $result_db->fetchArray()){ $array[$count]=$result; /*2D Array, an Stelle $count ist das $result Array mit Ergebnissen des SELECTs abgelegt*/ - $count++; +/* $count++; } return $array; } @@ -29,3 +41,4 @@ for($i=0;$i<$dimension;$i++){ echo "
"; } } +*/ -- cgit v1.2.3