Welcome Guest, Not a member yet? Register   Sign In
database class problem
#1

[eluser]emperius[/eluser]
I created an associative array
Code:
$addarray = array('field1' => $_POST['field1'], 'field2' => $_POST['field2']);
then I try to add this string to DB
Code:
$this->db->insert_string('table', $addarray)

this doesn't work at me

and when I try to see the query string I get empty string...

How to find out what is the problem?
And how can I see the query?
#2

[eluser]Sarfaraz Momin[/eluser]
incorrect
Code:
$this->db->insert_string('table', $addarray);
correct
Code:
$this->db->insert('table', $addarray);


Please check the manual for the same.

To check queries you can simply enable profiling and it will show you all the queries on the page.
Code:
$this->output->enable_profiler(TRUE);

Good Day !!!
#3

[eluser]xwero[/eluser]
If you want to check the last query you can use
Code:
$this->db->last_query();
#4

[eluser]emperius[/eluser]
thank you

everything works Smile




Theme © iAndrew 2016 - Forum software by © MyBB