Good night to all, once again live my Achilles heel with the blessed sql ...
I want to insert data into two tables ... client table and address.
I get the sql below, fill in the variables and execute the sql in phpmyadmin and it works ... then I get the sql that worked and I put it in my PHP and nothing ... it does not give error and does not insert ...
I searched for something related to mysql_insert_id () , but I do not know if I did it right.
Could you help me with this syntax?
$sql = "INSERT INTO 'endereco' ('id', 'rua', 'numero', 'bairro', 'cidade', 'cep')
VALUES (NULL, $logradouro, $numero, $bairro, $cidade, $cep);
$xy = mysql_insert_id();
INSERT INTO 'cliente' ('id', 'nome', 'profissao', 'endereco', 'email')
VALUES (NULL, $nome , $profissao, $xy,$email)";