1 | <?php |
||
36 | trait MySQLiMultiple |
||
37 | { |
||
38 | |||
39 | protected $mySQLconnection = null; |
||
40 | |||
41 | protected function executeMultipleRepetitiveValues($qry, $prmtrs) |
||
42 | { |
||
43 | $stmt = $this->mySQLconnection->stmt_init(); |
||
44 | if ($stmt->prepare($qry)) { |
||
45 | foreach ($prmtrs as $vParams) { |
||
46 | $paramType = $this->setVariableTypeForMySqlStatementsMany($vParams); |
||
47 | $aParams = []; |
||
48 | $aParams[] = &$paramType; |
||
49 | for ($counter = 0; $counter < $stmt->param_count; $counter++) { |
||
50 | $aParams[] = &$vParams[$counter]; |
||
51 | } |
||
52 | call_user_func_array([$stmt, 'bind_param'], $aParams); |
||
53 | $stmt->execute(); |
||
54 | } |
||
55 | $stmt->close(); |
||
56 | return ''; |
||
57 | } |
||
58 | } |
||
59 | |||
60 | protected function getMySqlCurrentDatabase() |
||
61 | { |
||
62 | return $this->mySQLconnection->query('SELECT DATABASE();')[0]; |
||
63 | } |
||
64 | |||
65 | /** |
||
66 | * Detects what kind of variable has been transmited |
||
67 | * to return the identifier needed by MySQL statement preparing |
||
68 | * |
||
69 | * @param type $variabaleValue |
||
70 | * @return string |
||
71 | */ |
||
72 | protected function setVariableTypeForMySqlStatements($variabaleValue) |
||
84 | |||
85 | protected function setVariableTypeForMySqlStatementsMany($variabales) |
||
86 | { |
||
93 | } |
||
94 |