0
Good evening to all, once again I live my Alans heel with the blessed sql...
I want to insert data in two tables... client table and address.
I take the sql below, fill the variables and run the sql in phpmyadmin and it works... then I take the sql that worked and put in my PHP and nothing... no error and nor insert...
I searched something related to mysql_insert_id(), but I don’t 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)";