1
I am creating a news system where the user has the option to register the news and put the original link where the news was generated, so far so good, the problem is that I want the user to have the option to register the news with the very link of the news that will be generated, I’m doing it this way:
$urlNoticia = "index.php?".PARAMETER_NAME_ACTION."=show&";
$urlNoticia .= PARAMETER_NAME_FILE."=exibir_noticia";
$urlNoticia .= "¬icia_id=".$model->getnoticia_id();
if(isset($_POST['FLinkNoticia'])) {
$error = $this->getConexao()->executeNonQuery($sql);
$sqll = "UPDATE noticia SET not_link = '".URL.$urlNoticia."SELECT MAX(noticia_id) FROM noticia' ";
$sqll .= "WHERE not_titulo = '".$model->getnot_titulo()."'";
$error = $this->getConexao()->executeNonQuery($sqll);
} else {
$error = $this->getConexao()->executeNonQuery($sql);
}
Flinknoticia is a checkbox.
At first $error
he makes the Insert in the bank, and shortly after he must make a UPDATE
, it until it realizes the UPDATE
but does not bring the news ID, only the URL
you want to catch the
id
table in update?– rray
Yeah, I want to take the last
id
inserted ! @rray– Ikaro Sales
I don’t understand your question. Don’t you already have the id value before you update? By the way why don’t you use the news id in Where?
– LF Ziron