I am trying to get some data from the db but it's across 2 separate tables of data. I am unsure of the best way to go about solving a problem like this.
Also both tables need the charid but I don't know if I need to bind it again.
<?php
include_once "mmoconnection.php";
$mydata = json_decode(file_get_contents('php://input'));
$charid = $mydata ->charid;
$userid = $mydata ->userid;
$stmt = $conn->prepare("SELECT name, health, mana, level, experience, clan, posx, posy, posz, rotation_yaw,
equip_head, equip_chest, equip_hands, equip_legs, equip_feet, hotbar0, hotbar1, hotbar2, hotbar3 FROM characters WHERE id = ? ");
$stmt->bind_param("i", $charid); // "i" means the database expects an integer
$stmt->execute();
$stmt->bind_result($row_name, $row_health, $row_mana, $row_level, $row_experience, $row_clan_id, $row_posx, $row_posy, $row_posz, $row_rotation_yaw,
$row_equip_head, $row_equip_chest, $row_equip_hands, $row_equip_legs, $row_equip_feet, $row_hotbar0, $row_hotbar1, $row_hotbar2, $row_hotbar3);
$stmt = $conn->prepare("SELECT 1, 2 FROM skills WHERE id = ? ");
$stmt->bind_result($row_1, $row_2);
// output data of each row
if($stmt->fetch()) {
//other code
}
?>