$query = $this->db->prepare("INSERT INTO `images` (`anunt`, `image_location`) VALUES(?, ?)");
$query->bindValue(1, $iddd);
$query->bindValue(2, $image_location);
try{
$query->execute();
or this
$ret = sql_query("INSERT INTO images (anunt, image_location) VALUES ('" .$iddd. "', '" .$image_location. "')");
Or another way maybe? What advantages are with the bind one? I read something that it's hard to sql inject.