1
I have the following function:
public function excluir ($idPlano) {
$string1 = "DELETE FROM planos WHERE idPlano = ".$idPlano;
$string2 = "DELETE FROM fotos WHERE idPlano = ".$idPlano;
$this->conexao->query($string1);
$this->conexao->query($string2);
}
I’d like to do something like:
public function excluir ($idPlano) {
$string = "DELETE FROM planos WHERE idPlano = ".$idPlano;
$string .= "DELETE FROM fotos WHERE idPlano = ".$idPlano;
return $this->conexao->query($string) ? 1 : 2;
}
Do 2 searches only 1.
Like?
Kind of a CONCAT...
If you do
DELETE FROM plano, fotos ...
does not work? Or then change the end of sql toidPlano = $idPlano;";
adding a;
at the end of the string– Costamilam