So after I have created the table 'settings-table' i want to add a couple of records to it.
This is how I want to do it, not the best way, so I need a better way to do this because I will add more records to the table.
EXAMPLE 1
$wpdb->insert('settings-table', array('option_name' => 'name-1',
'option_value' => 'val-1',
'option_created'=> current_time('mysql'),
'option_edit' => current_time('mysql'),
'option_user' => 'user-1'
));
$wpdb->insert('settings-table', array('option_name' => 'name-2',
'option_value' => 'val-2',
'option_created'=> current_time('mysql'),
'option_edit' => current_time('mysql'),
'option_user' => 'user-2'
));
$wpdb->insert('settings-table', array('option_name' => 'name-1',
'option_value' => 'val-3',
'option_created'=> current_time('mysql'),
'option_edit' => current_time('mysql'),
'option_user' => 'user-3'
UPDATE
this works(any other better solutions are welcome)
$wpdb->query("INSERT INTO settings-table
(`option_name`, `option_value`, `option_created`, `option_edit`, `option_user`)
VALUES
('name-1', 'val-1', current_time('mysql'), current_time('mysql'), 'user-1'),
('name-2', 'val-2', current_time('mysql'), current_time('mysql'), 'user-2'),
('name-3', 'val-3', current_time('mysql'), current_time('mysql'), 'user-3')")
optionstable (with all of the WP functionality that exists for it), orpostmetaorusermeta(again, with all the WP functionality that already exists around them). Finally: if you want to use your own table, a loop would probably give you what you want, but we'd to have more context, understand what it is you're trying to accomplish "big picture"prepareis incorrect, which would probably generate a warning. see the codex for the correct format.