Chore: Verschiebe Git-Repository in das Hauptverzeichnis und richte .gitignore ein
This commit is contained in:
commit
96d0545193
502 files changed
+176027
No files matched your search
@@ -0,0 +1,79 @@
|
||||
#!/usr/bin/php
|
||||
<?php
|
||||
ini_set('memory_limit', '-1');
|
||||
require "libs/Medoo.php";
|
||||
require "libs/forceutf8-master/src/ForceUTF8/Encoding.php";
|
||||
use Medoo\Medoo;
|
||||
use \ForceUTF8\Encoding;
|
||||
|
||||
|
||||
// NEW DATA
|
||||
$database = new Medoo([
|
||||
'database_type' => 'mysql',
|
||||
'database_name' => 'gutachten9_t3',
|
||||
'server' => '127.0.0.1',
|
||||
'username' => 'root',
|
||||
'password' => 'Salam0815!',
|
||||
'charset' => 'utf8',
|
||||
]);
|
||||
|
||||
|
||||
$marie_id = 2;
|
||||
|
||||
// SELECT *
|
||||
// FROM information_schema.tables
|
||||
// WHERE table_schema = 'yourdb'
|
||||
// AND table_name = 'testtable'
|
||||
// LIMIT 1;
|
||||
$arr = $database->select('tx_gutachten_freigabe_orig','*');
|
||||
if(!\count($arr)){
|
||||
|
||||
note("CREAT NEUE FREIGABE");
|
||||
|
||||
$database->exec("RENAME TABLE tx_gutachten_freigabe TO tx_gutachten_freigabe_orig");
|
||||
debug_sql(__line__);
|
||||
|
||||
$database->exec("CREATE TABLE `tx_gutachten_freigabe` (`id` int(11) NOT NULL AUTO_INCREMENT,`userid` int(11) NOT NULL,`projektid` int(11) NOT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB AUTO_INCREMENT=5017 DEFAULT CHARSET=utf8");
|
||||
debug_sql(__line__);
|
||||
|
||||
$arr = $database->select('tx_gutachten_freigabe_orig','*');
|
||||
foreach ($arr as $key => $value) {
|
||||
if($value['onoff'] == 'active'){
|
||||
$database->insert("tx_gutachten_freigabe",['userid' => $value['uid'], 'projektid' => $value['pid']]);
|
||||
debug_sql(__line__);
|
||||
}
|
||||
if($value['uid'] == $marie_id){
|
||||
$database->update("tx_gutachten_projekte",['status' => $value['status']], ['id' => $value['pid']]);
|
||||
debug_sql(__line__);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
note("DONE");
|
||||
exit;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function note($txt)
|
||||
{
|
||||
echo PHP_EOL . "---------------------------------------------------------------------" . PHP_EOL;
|
||||
echo $txt;
|
||||
echo PHP_EOL . "---------------------------------------------------------------------" . PHP_EOL;
|
||||
}
|
||||
function debug_sql($line)
|
||||
{
|
||||
global $database;
|
||||
note($line . ": " . str_replace('"', "", $database->last()));
|
||||
}
|
||||
Reference in new issue
Block a user