1
0
This repository has been archived on 2023-11-30. You can view files and clone it, but cannot push or open issues or pull requests.
dtux__nextcloudconnector4do.../findindb.php

47 lines
1.0 KiB
PHP
Raw Normal View History

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 21:19:04 +02:00
//print_r($s);
2019-09-02 21:17:39 +02:00
2019-09-02 21:33:08 +02:00
//echo EOL;
if ( $s[0] == 'mail') echo "######################################### mail" . EOL ;
2019-09-02 21:30:20 +02:00
$query="SELECT * FROM " . $table['Tables_in_nextcloud'] . " WHERE '" . $s[0] . "' LIKE '%" . $string . "%'";
2019-09-02 21:35:01 +02:00
echo $query . "\n";
2019-09-02 21:17:39 +02:00
$db2->query($query);
if ( $db2->result->num_rows != 0 )
2019-09-01 22:13:00 +02:00
{
2019-09-02 21:17:39 +02:00
$tableau = $db2->result->fetch_all();
echo "column " . $s[0] . "\n";
print_r($tableau);
2019-09-01 23:38:12 +02:00
echo EOL;
2019-09-01 22:13:00 +02:00
}
2019-09-02 21:17:39 +02:00
2019-09-01 22:13:00 +02:00
}
2019-09-01 21:00:27 +02:00
}
2019-09-01 20:42:03 +02:00
?>