Tuesday, 15 February 2011

php - Codeigniter Error Input data -



php - Codeigniter Error Input data -

i seek insert info using codeigniter. when info have question symbol, error. seek direct database work when seek run in codeigniter it's not working.

can help me, or thought solve problem.

my query:

insert wik_policy (product,adv) values ('cup' ,'are familiar cup?')

you have many ways insert info in database. sick show bests ways it.

using set , insert function:

$this->db->set('name', $name); $this->db->insert('mytable');

//result : produces: insert mytable (name) values ('{$name}');

using $this->db->insert():

$data = array( 'title' => 'my title' , 'name' => 'my name' , 'date' => 'my date' ); $this->db->insert('mytable', $data);

// produces: insert mytable (title, name, date) values ('my title', 'my name', 'my date')

try check if construction of adv field in mysql, check if varchar or text , limit of characters.

i recommend utilize function: $this->output->enable_profiler(true);

the profiler class display benchmark results, queries have run, , $_post info @ bottom of pages. info can useful during development in order help debugging , optimization.

php mysql codeigniter

No comments:

Post a Comment