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

42 lines
1011 B
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-01 23:26:49 +02:00
print_r($s[0]) . "\n";
2019-09-01 23:36:01 +02:00
echo "SELECT * FROM " . $table['Tables_in_nextcloud'] . " WHERE " . $s[0] . "='" . $string . "'\n";
2019-09-01 23:26:49 +02:00
$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";
2019-09-01 23:36:01 +02:00
print_r($tableau) . 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
?>