connect_error) { exit(); die("Connection failed: " . $conn->connect_error); } mysqli_set_charset($conn,"utf8"); if (intval($queries["id"]) === 0){ $notebook = ["id" => 0, "title" => "My Archives"]; } else { $sql = "SELECT id, title FROM `notebook` WHERE user_id={$_SESSION["user_id"]} AND id={$queries["id"]};"; $result = $conn->query($sql); if ($result->num_rows == 0){ header('Location: ./list.html'); exit(); } else { $notebook = $result->fetch_assoc(); } } } ?> NOTEBOOK | Create NOTEBOOK





query($sql); $questions = array(); if ($result->num_rows > 0){ while ($row = $result->fetch_assoc()){ // $sql = "SELECT * FROM `my_sentences_translation` WHERE sen_post_id={$row['mysen_post_id']};"; // $translation = $conn->query($sql); // $translation = $translation->fetch_assoc(); // $row["translated_content"] = $translation["translated_content"]; array_push($questions, $row); } } foreach ($questions as $index => $question) { $question['original_content'] = str_replace("\"", """, $question['original_content']); $question['translated_content'] = str_replace("\"", """, $question['translated_content']); echo "
\n"; if ($index != 0){ echo "
"; } echo "
"; echo "
\n"; } mysqli_close($conn); ?>


"; } ?>