mirror of
https://gitlab.com/hashborgir/d2tools.git
synced 2025-09-19 01:52:09 +00:00
Working copy
This commit is contained in:
@@ -140,6 +140,24 @@ class D2Database {
|
||||
$res = PDO_Execute($sql);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $data
|
||||
* @return void
|
||||
*/
|
||||
public function writeTbls($table,$data) {
|
||||
$sql = "CREATE TABLE IF NOT EXISTS `$table` (`Key` VARCHAR(255), `String` VARCHAR(255));";
|
||||
$res = PDO_Execute($sql);
|
||||
|
||||
$sql = "INSERT INTO `$table` (`Key`,`String`) VALUES ";
|
||||
foreach ($data as $k => $v) {
|
||||
$sql .= "(\"$k\",\"$v\"),";
|
||||
}
|
||||
$sql = rtrim($sql, ", ");
|
||||
$sql .= ";";
|
||||
|
||||
$res = PDO_Execute($sql);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $key
|
||||
* @return mixed
|
||||
|
Reference in New Issue
Block a user