I’m using Codeigniter to insert some data into a MySQL table. However, the single quotes automatically added in is giving me a problem with 'p' => 'POINT(1 1)' because this causes the SQL query generated to be 'POINT(1,1)' instead of POINT(1,1). If i pass the false 2nd parameter, all the single quotes will be removed from the generated SQL query. How should I approach this problem?
PHP Code
$data = array( 'lat' => $url['lat'],
'lng' => $url['lng'],
'p' => 'POINT(1 1)'
);
$this->db->insert('listings', $data);
Try to do something like
The second parameter will make sure that the value isn’t escaped.
Sorry if my answer is wrong, I am not using Codeigniter