4
I have two tables:
hardware(ID, DEVICEID, NAME, ...)
and
softwares(ID, HARDWARE_ID, PUBLISHER, NAME, VERSION, ETC ...).
I need to give insert in the software table, but I do not have the HARDWARE_ID
, I only get the name of the hardware (hardware.NAME
), that HARDWARE_ID
is what makes the relationship between the tables.
I don’t want to select the hardware where name = $software['server_name']
for each record line, I am creating an API that will include arrays of software sent via JSON.
Someone can help me?
well you will have to do the search for HARDWARE_ID somehow. if it is not through select, see the possibility to receive the id in json.
– Marco Souza
Possible duplicate of how to take data from one mysql table and insert into another :?
– Sorack