// set nav dropdown name $nav_dropdown_name = "tools"; // set nav page name $nav_page_name = "tools_tutorials"; // start the session session_start(); //Connecting to database $dbhost = 'localhost'; $dbuser = 'bptraining_admin'; $dbpass = 'Blr1gbattlemaster'; $dbname = 'blue_path_training'; $conn = mysqli_connect($dbhost, $dbuser, $dbpass,$dbname); if(! $conn ) { die('Could not connect: ' . mysqli_error()); } // include content functions include("functions/functions_content.php"); // get the content_id from the querystring $content_id = $_GET["content_id"]; // Get the content data for the tutorial $result_content = mysqli_query($conn, "SELECT * FROM content WHERE content_id = " . $content_id); while ($query_data_content = mysqli_fetch_assoc($result_content)) { $tutorial_name = $query_data_content["name"]; $youtube_embed_code = $query_data_content["video_embed"]; $tutorial_code = $query_data_content["code"]; } ?>
// get all of the tags for this content piece $result_content_tags = mysqli_query($conn, "SELECT tags.*, tags_to_content.* FROM tags, tags_to_content WHERE tags.tag_id = tags_to_content.tag_id AND tags_to_content.content_id = " . $content_id . " ORDER BY tags.output_order"); while ($query_data_content_tags = mysqli_fetch_assoc($result_content_tags)) { // get the tag ID $tag_id = $query_data_content_tags["tag_id"]; // pull the id and name for the tag $result_tag_info = mysqli_query($conn, "SELECT * FROM tags WHERE tag_id = " . $tag_id); while ($query_data_tag_info = mysqli_fetch_assoc($result_tag_info)) { ?> echo $query_data_tag_info["tag_name"]; ?> } } ?>