summaryrefslogtreecommitdiff
path: root/www/select.php
diff options
context:
space:
mode:
Diffstat (limited to 'www/select.php')
-rw-r--r--www/select.php22
1 files changed, 13 insertions, 9 deletions
diff --git a/www/select.php b/www/select.php
index 1dda9cf..78ab1bc 100644
--- a/www/select.php
+++ b/www/select.php
@@ -3,18 +3,22 @@
//session_start();
$db = new SQLite3("../database/sqlite.db");
-$user=2;
-$parent=1;
+$owner=2;
+$parentdir=0;
+$count=0;
$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();
+while($result[$count]=$result_db->fetchArray(SQLITE3_NUM)){
+ while(!empty($result)){
+ $dimension = count($result);
+ for($i=0;$i<$dimension;$i++){
+ echo "result: " . $result[$i][2] . " dimension: " . $dimension . " ";
+ $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[$count]=$result_db->fetchArray();
+ }
}
+ $count++;
}
/*