I
I
Igor Tkachenko2015-01-22 04:27:58
MySQL
Igor Tkachenko, 2015-01-22 04:27:58

Why does nothing happen when inserting a record into kohana 3 via DB::insert?

I'll give an example:

$query = DB::insert('tasks', array('system_uid', 'socialnetwork_gid'))
            ->values(array('1', '22'));

After this request, this is the response:
object(Database_Query_Builder_Insert)#82 (10) {
  ["_table":protected]=>
  string(13) "posting_tasks"
  ["_columns":protected]=>
  array(2) {
    [0]=>
    string(10) "system_uid"
    [1]=>
    string(17) "socialnetwork_gid"
  }
  ["_values":protected]=>
  array(1) {
    [0]=>
    array(2) {
      [0]=>
      string(1) "1"
      [1]=>
      string(2) "22"
    }
  }
  ["_type":protected]=>
  int(2)
  ["_force_execute":protected]=>
  bool(false)
  ["_lifetime":protected]=>
  NULL
  ["_sql":protected]=>
  string(0) ""
  ["_parameters":protected]=>
  array(0) {
  }
  ["_as_object":protected]=>
  bool(false)
  ["_object_params":protected]=>
  array(0) {
  }
}

But the table does not record. Empty...
I'm making this request from a module, what should I do?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Balobanov, 2015-01-22
@pchelkin

Well, apparently you need to do ->execute ()
What do you think? )

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question