MH90 Posted March 23, 2020 Share Posted March 23, 2020 <?php include 'includes/header.php'; include 'includes/navbar.php'; include 'includes/leftSidebar.php'; ?> <?php if(isset($_GET['update'])){ $the_mentor_id = $_GET['update']; $query = "SELECT * FROM mentor WHERE mentor_id = '$the_mentor_id' "; $update_mentor = mysqli_query($db, $query); while ( $row = mysqli_fetch_assoc($update_mentor) ) { $mentor_id = $row['mentor_id']; ?> <h1>i am h1</h1> <?php } } ?> <?php include 'includes/footer.php'; ?> Why <h1> I am h1</h1> this line is not showing, I am totally new in PHP , Please Help me Quote Link to comment Share on other sites More sharing options...
Barand Posted March 23, 2020 Share Posted March 23, 2020 You probably have an error that stops the page executing. Turn on error reporting in your php.ini file. Quote Link to comment Share on other sites More sharing options...
MH90 Posted March 23, 2020 Author Share Posted March 23, 2020 @Barand ok , i am doing Quote Link to comment Share on other sites More sharing options...
ginerjm Posted March 23, 2020 Share Posted March 23, 2020 OR you don't have any query results to loop thru. Here's a cleaned up version of your current code. <?php if(isset($_GET['update'])) { $the_mentor_id = $_GET['update']; $query = "SELECT mentor_id, field2, field3, field4,..... FROM mentor WHERE mentor_id = '$the_mentor_id' "; $qresults = mysqli_query($db, $query); while ($row = mysqli_fetch_assoc($qresults)) { $mentor_id = $row['mentor_id']; echo "<h1>i am h1</h1>"; } } include 'includes/footer.php'; Question - Does the "footer.php" actually contain php code or is it the footer of your html page? Don't name it .php if it is just html code You need to start using prepared queries. Check out the manual. And if you are really new, read the PDO stuff instead of the MySQLI stuff. It's easier and better for you. Quote Link to comment Share on other sites More sharing options...
MH90 Posted March 23, 2020 Author Share Posted March 23, 2020 @ginerjm Thanks for your reply, footer.php contains jquery files Quote Link to comment Share on other sites More sharing options...
ginerjm Posted March 23, 2020 Share Posted March 23, 2020 So - Not PHP? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.