-2
Hello, I’m trying to make two inserts in php like this:
function insereProduto($conexao, $nome, $cor, $preco){
$sql="insert into produtos (nome, cor) values ('{$nome}','{$cor}')");
$sql2="insert into preco (preco) value ({$preco});");
return mysqli_query($conexao, $sql. ";". $sql2);
}
What am I doing wrong? Thanks in advance.
Something is very strange in your code. After you insert 2 products or more, how do you know which price is of which product? If this was a past exercise, it is the recommendation of who drafted the review methodology. Exercise with too artificial condition harms the student.
– Bacco