getMessage()) and die(); } // //--------------- // // Query and sending results // //--------------- header('Content-Type: application/json'); $encodedData=file_get_contents('php://input'); $decodedData=json_decode($encodedData, true); $FindUID=$decodedData["FindUID"]; $query= "SELECT UID, EID from joins"; $stmt=mysqli_prepare($connection, $query); mysqli_stmt_execute($stmt); mysqli_stmt_bind_result($stmt, $uid, $eid); while(mysqli_stmt_fetch($stmt)){ $response[] = array("uid"=>$uid, "eid"=>$eid); } // if(mysqli_num_rows($stmt)>0) // { // $Row = mysqli_fetch_assoc($stmt); // $eid = $Row['eid']; // $name = $Row['name']; // $start_date = $Row['start_date']; // $end_date = $Row['end_date']; // $participant_count = $Row['participant_count']; // $participant_limit = $Row['participant_limit']; // $description = $Row['description']; // } // else // { // $eid = ""; // $name = ""; // $start_date = ""; // $end_date = ""; // $participant_count = ""; // $participant_limit = ""; // $description = ""; // } // ---------------------------------------------- // $eid = '1'; // $name = 'testEvent'; // $start_date = '2023-01-07'; // $end_date = '2023-01-23'; // $participant_count = '13'; // $participant_limit = '20'; // $description = 'TEST TEST TEST TEST TEST TEST TEST TEST'; //----------------------------------------------- // $response[] = array("eid"=>$eid, "name"=>$name, "Sdate"=>$start_date, "Edate"=>$end_date, "Pcount"=>$participant_count, "Plimit"=>$participant_limit, "description"=>$description); echo json_encode($response); // $TPMGJson = json_encode($response); // file_put_contents('./events.json', $TPMGJson); // echo $TPMGJson; ?>