1
I have the following code:
$sql = mysql_query("INSERT INTO TB004_PRODUTO_FORNECEDOR ( TB002_CODIGO, TB003_CODIGO )
SELECT TB003_CODIGO, 1 AS Codigo FROM TB003_PRODUTO WHERE TB003_DESCRICAO = '$name_02'
VALUES ( '$name_01', Codigo )");
How can I select the product code within Insert for it to just enter the code?
If that’s possible, I’d like to know.. rsrs. Just don’t use the
mysql_*
, because it is outdated. Use themysqli_*
orPDO
– Andrei Coelho
@Andreicoelho I’ve done in the
PDO
, but in this case I can’t, as much as I’d like to, I’ll have tomsql
even.– Wagner Viana
Got it =)... the answer below seems valid
– Andrei Coelho