Da hatteich das hier gefunden:
Code: Alles auswählen
$sql_ary = array(
'somedata' => $my_string,
'otherdata' => $an_int,
'moredata' => $another_int,
);
$db->sql_query('INSERT INTO ' . SOME_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary));
Und versucht das versucht zu nutzen für insert aber das hat so nicht geklappt mit dieser version:
'somedata' => $my_string,
ok ich sehe du hast diese $... nach den => durch angaben in hochkommas ersetzt. Auf die Idee mus man auch erstmal kommen.
@edit
Also das hier z.B. kann ich nutzen und funktioniert:
$this->db->sql_build_array
ebenso dies hier:
$this->db->sql_query($sql);
aber sobald ich das hier lade:
$db->sql_query
oder dies hier:
$db->sql_build_array
quittiert mir mein testserver mit ner fehlermeldung von wegen:
Fatal error: Uncaught Error: Call to a member function sql_build_array() on null in C:\xampp\73\htdocs\wwh\ext\chris1278\cookie\migrations\v_1_0_4.php:37 Stack trace: #0 [internal function]: chris1278\cookie\migrations\v_1_0_4->import_optin(NULL) #1 C:\xampp\73\htdocs\wwh\phpbb\db\migrator.php(714): call_user_func_array(Array, Array) #2 C:\xampp\73\htdocs\wwh\phpbb\db\migrator.php(661): phpbb\db\migrator->run_step(Array, NULL, false) #3 C:\xampp\73\htdocs\wwh\phpbb\db\migrator.php(436): phpbb\db\migrator->process_data_step(Array, Array) #4 C:\xampp\73\htdocs\wwh\phpbb\db\migrator.php(288): phpbb\db\migrator->try_apply('\\chris1278\\cook...') #5 C:\xampp\73\htdocs\wwh\phpbb\db\migrator.php(241): phpbb\db\migrator->update_do() #6 C:\xampp\73\htdocs\wwh\phpbb\extension\base.php(78): phpbb\db\migrator->update() #7 C:\xampp\73\htdocs\wwh\phpbb\extension\manager.php(231): phpbb\extension\base->enable_step(true) #8 C:\xampp\73\htdocs\wwh\includes\acp\acp_extensions.php(209): phpbb\extension\manager->enable_step('chris1278/cooki. in C:\xampp\73\htdocs\wwh\ext\chris1278\cookie\migrations\v_1_0_4.php on line 37
Dies hier lädt er ohne Probleme:
Code: Alles auswählen
$sql_ary = array(
'chris1278_name' => 'storage2_version',
'chris1278_value' => 'cookie2',
);
$sql = ('INSERT INTO ' . $this->table_prefix . 'chris1278_cookie ' . $this->db->sql_build_array('INSERT', $sql_ary));
$this->db->sql_query($sql);