Lars Berg wrote:
insert into banned
select countrycode,91
from countrycodes
where country='Zimbabwe'
should do nicely.
Ok, that would put data in just one table, right?
How can I set a field value on a particular row on table.A and also insert several values in table.B?
This is my query to show results from the table we're gonna get the values to work with (table.A).
Note that I can't use an ID to join the tables, but I can do it via three fields (nombre, valor and folio):
$sql = "SELECT folio, nombre, valor, proveedor, estado, fecha, SUM(cantidad) as 'cantidadtotal', SUM(costo * cantidad) as 'costototal'
FROM insumos
WHERE folio='" . $_GET[folio] . "'
GROUP BY nombre, valor
ORDER BY folio";
Order# is NOT a unique field. But I can sort products by name and value.
table.A example:
ID------ORDER#---NAME---------VALUE---------SATUS------------TRANSACTION
1 555 GOLD 24K Available CONFIRMED
2 777 SILVER 14K Processing NOT CONFIRMED
3 555 ALEATION .585 Devolution CONFIRMED
table.B example:
ID-----ORDER#----NAME---------VALUE---------A DIFFERENT FIELD---------------
Briefly:
I would like to update Transaction field in (table.A) AND insert similar values to (table.😎, selecting table.A result via grouping by Name and Value, where Order# equals some number.
Table.A results are shown in a HTML form so table B will get values via $_POST[] method. This example would not work for me I believe.