php - Query to add into multiple tables not working
439
I've got a query which should insert data into multiple tables, but I get a 500 error when I try to execute it.
What is the problem?
My Query:
$addcompany = "
BEGIN;
INSERT INTO company (name, street, zip, place, phone, contact, email, logo)
VALUES('".$name."', '".$street."', '".$zip."', '".$place."', '".$phone."', '".$contact."', '".$email."', '".$file."');
INSERT INTO users (username, password)
VALUES('".$username."', '".$pass."');
COMMIT";
$addcompany = $conn->query($updatecompany);
I post using ajax, and the 500 error shows me this line:
c = c("abort");
try {
h.send(b.hasContent && b.data || null)
} catch (i) {
if (c)
throw i
}
It's a 500 internal server error.