I'm trying to insert data into one table and select the ID and insert additional information in another table related to the ID, My code is below (I'm not exactly advanced so please be patient, I'm looking to solve this not learn something completely different if possible), This code works up to "INSERT INTO sb_admins_servers_groups" then stops.
$sql = 'INSERT INTO sb_admins (user, authid, password, gid, email, validate, extraflags, immunity, srv_group, srv_flags, srv_password, lastvisit)
VALUES (:name, :ID, "#######", "-1", "", "", "0", "0", "X Permissions", "", "", "");
SELECT aid FROM sb_admins WHERE authid = :ID
INSERT INTO sb_admins_servers_groups (admin_id, group_id, srv_group_id, server_id)
VALUES (aid, "5", "4", "-1")';
$s=$pdo->prepare($sql);
$s->bindvalue('name', $player->name);
$s->bindvalue('ID', $player->uniqueid);
$s->execute();
}
catch(PDOException $e)
{
echo "There was an error " . $e->getMessage() . "";
exit();
}