summaryrefslogtreecommitdiff
path: root/www/select.php
blob: eb9ce8c73d905f1ef89858b4dcd15f0e2617da33 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?

//session_start();

$db = new SQLite3("../database/sqlite.db");
$user=2;
$parent=0;

function select_db ($parentdir, $owner, $db){
	$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++;
	}

	return $array;
}

$row = select_db($parent, $user, $db);
var_dump($row);