I am trying to save data in two different database tables , when i run two query it save 0 in the integer field.
$sql = 'insert into photo_album( user_id, photo_id, album_id )
values(". $user_id.",".$photo_id.",". $album_id.")';
$query = $this->db->query($sql);
but when i run query as hard coded values it work fine.
INSERT INTO
photo_album( photo_id, user_id, album_id )
VALUES(8299,214,316)
can some one tell what is wrong ?