2019-09-01 20:42:03 +02:00
|
|
|
#!/usr/bin/php
|
|
|
|
|
|
|
|
<?php
|
2019-09-01 23:04:23 +02:00
|
|
|
|
|
|
|
require("session_init.php");
|
|
|
|
require("config.inc.php");
|
|
|
|
require("log.php");
|
2019-09-01 20:42:03 +02:00
|
|
|
require("db.class.php");
|
2019-09-01 23:04:23 +02:00
|
|
|
|
2019-09-01 20:42:03 +02:00
|
|
|
$database = $argv[1];
|
2019-09-01 22:13:00 +02:00
|
|
|
$string = (isset($argv[2]))?$argv[2]:"";
|
2019-09-01 23:02:41 +02:00
|
|
|
function esp( $s )
|
|
|
|
{
|
|
|
|
$s = " $s ";
|
|
|
|
return $s;
|
|
|
|
}
|
2019-09-01 20:59:27 +02:00
|
|
|
$db1 = new db ("nextcloud");
|
|
|
|
$db2 = new db ("nextcloud");
|
|
|
|
$db1->query("SHOW tables FROM $database;");
|
2019-09-01 23:28:30 +02:00
|
|
|
print_r($db1);
|
2019-09-01 20:59:27 +02:00
|
|
|
while( $table = $db1->result->fetch_assoc())
|
|
|
|
{
|
2019-09-01 22:20:13 +02:00
|
|
|
echo "======================>" . $table['Tables_in_nextcloud'] ."\n";
|
2019-09-01 21:14:21 +02:00
|
|
|
$db2->query("SHOW columns FROM " . $table['Tables_in_nextcloud']);
|
2019-09-01 21:26:10 +02:00
|
|
|
$columns = $db2->result->fetch_all();
|
2019-09-01 22:19:10 +02:00
|
|
|
foreach($columns AS $key=>$s)
|
2019-09-01 22:13:00 +02:00
|
|
|
{
|
2019-09-01 23:26:49 +02:00
|
|
|
print_r($s[0]) . "\n";
|
|
|
|
$db2->query("SELECT * FROM " . $table['Tables_in_nextcloud'] . " WHERE " . $s[0] . "='" . $string . "'");
|
2019-09-01 23:30:13 +02:00
|
|
|
if ( $db2->result->num_rows != 0 )
|
2019-09-01 22:13:00 +02:00
|
|
|
{
|
2019-09-01 23:26:49 +02:00
|
|
|
$tableau = $db2->result->fetch_all();
|
|
|
|
echo "column " . $s[0] . "\n";
|
|
|
|
print_r($tableau);
|
2019-09-01 22:13:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2019-09-01 21:00:27 +02:00
|
|
|
}
|
2019-09-01 20:42:03 +02:00
|
|
|
?>
|