I've spent the past while trying different ways to format this SQL query so that it works, but to no success...
Basically I want the php code to insert a row in a table (faults) and then to update the status of a computer in another table (computer).
So something like this:
$sql = "INSERT INTO Fault SET CompID='$CompID', Type='$Type', Description='$Description', StaffID='$StaffID', TechID='Unknown'";
Together with:
$sql = "UPDATE Workstation SET
Status='Attention'
WHERE CompID='$CompID'";
I have no idea how to combine these two queries... someone mentioned INNER JOIN but I cant get my head around that to any success either! Would anyone be able to point me in the right direction? Cheers
Basically I want the php code to insert a row in a table (faults) and then to update the status of a computer in another table (computer).
So something like this:
$sql = "INSERT INTO Fault SET CompID='$CompID', Type='$Type', Description='$Description', StaffID='$StaffID', TechID='Unknown'";
Together with:
$sql = "UPDATE Workstation SET
Status='Attention'
WHERE CompID='$CompID'";
I have no idea how to combine these two queries... someone mentioned INNER JOIN but I cant get my head around that to any success either! Would anyone be able to point me in the right direction? Cheers