<?php


header('Access-Control-Allow-Origin: *');
header("Content-type: application/json; charset=utf-8");


// include '../utils/database.php';
// include '../utils/helper.php';

// showErrors();

// // Create connection
// $conn = new mysqli($servername, $username, $password, $dbname_process);
// // Check connection
// mysqli_set_charset($conn, "utf8");
// if ($conn->connect_error) {
//     die("Connection failed: " . $conn->connect_error);
// }


// $resultAllAnswers = $conn->query("SELECT * FROM ai_answersV2 WHERE `type`='fastfit'");
// if ($resultAllAnswers->num_rows > 0) {
//     while ($row_aa = $resultAllAnswers->fetch_assoc()) {
//         $qid = $row_aa["qid"];

//         $resultAllAnswersIn = $conn->query("SELECT * FROM ai_answersV2 WHERE `next_question`='$qid'");
//         if ($resultAllAnswersIn->num_rows > 0) {
//             while ($row_aaIn = $resultAllAnswersIn->fetch_assoc()) {
//                 $aidIn = $row_aaIn["aid"];

//                 $conn->query("UPDATE ai_answersV2 SET `prev_question`='$aidIn' WHERE `qid`='$qid'");
//             }
//         }
//     }
// }
