I have a piece of code:
// trainer query
$query = "INSERT INTO ".TBL_USERS." SET username = :username, password = :password, alliance = :alliance, avatar = :avatar, gender = :gender, usersalt = :usersalt, userid = 0, userlevel = $ulevel, email = :email, timestamp = $time, actkey = :token, ip = '$userip', regdate = $time";
$stmt = $this->connection->prepare($query);
return $stmt->execute(array(':username' => $username, ':password' => $password, ':usersalt' => $usersalt, ':alliance' => $alliance, ':avatar' => $avatar, ':gender' => $gender, ':email' => $email, ':token' => $token));
// pokemon query
$query2 = "INSERT INTO ".TBL_POKEMON." SET Trainer = :trainer, OTrainer = :otrainer, Pokemon = :pokemon, shiny = :shiny, Level = :level, Nlevel = :nlevel, EXP = :exp, EXPN = :expn, HP = :hp, mhp = :mhp, Gender = :gender, Item = :item, Attack1 = :attack1, Attack2 = :attack2, Attack3 = :attack3, Attack4 = :attack4";
$stmt2 = $this->connection->prepare($query2);
return $stmt2->execute(array(':trainer' => $username, ':otrainer' => $username, ':pokemon' => $starter, ':shiny' => $shiny, ':level' => 10, ':nlevel' => 11, ':exp' => 1001, ':expn' => 1331, ':hp' => $hp2, ':mhp' => $hp2, ':gender' => $gender, ':item' => None, ':attack1' => $attack1, ':attack2' => $attack2, ':attack3' => $attack3, ':attack4' => $attack4));
Now I want both queries to be submitted into the database however, only the trainer query seems to be working. If I remove the trainer query and leave the pokemon query, the pokemon query works. But if I use them both together, they don't seem to be working... am I doing something wrong?
Edit: When I used them both together, I used stmt2 and query2, and I even tried both of them as stmt and query.. so I'm really stumped.