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:36:01 +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-02 19:03:05 +02:00
|
|
|
print_r($s);
|
2019-09-01 23:38:12 +02:00
|
|
|
echo EOL;
|
2019-09-02 19:01:58 +02:00
|
|
|
$query="SELECT * FROM " . $table['Tables_in_nextcloud'] . " WHERE " . $s[0] . " LIKE '" . $string . "'";
|
|
|
|
echo $query . "\n";
|
2019-09-02 18:56:33 +02:00
|
|
|
$db2->query($query);
|
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";
|
2019-09-01 23:38:12 +02:00
|
|
|
print_r($tableau);
|
|
|
|
echo EOL;
|
2019-09-01 22:13:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2019-09-01 21:00:27 +02:00
|
|
|
}
|
2019-09-01 20:42:03 +02:00
|
|
|
?>
|