Guest User

Untitled

a guest
Feb 16th, 2019
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. <div class="header">
  2. <div class="logo">
  3. <a href="index.php"><img src="images/logo.jpg" alt="logo" /></a>
  4. </div><!--logo ends-->
  5. <div class="navigation">
  6. <?php
  7.  
  8. $cat_sql = "SELECT * FROM category";
  9. $cat_query = $conn->query($cat_sql);
  10. while ($cat_results = $cat_query->fetch_array()){
  11. $category_page = "category.php?categoryID=" .$cat_results['categoryID'];
  12. session_start();
  13. echo session_id();
  14. echo "<a href='$category_page'>". $cat_results['name'] ." </a>";
  15. }
  16. CloseCon($conn)
  17. ?>
  18. <a href="admin.php">Admin</a>
  19. </div><!--navigation ends-->
  20. </div><!-- Header ends here-->
  21.  
  22. $servername = "localhost";
  23. $username = "root";
  24. $password = "123456789";
  25. $database = "accessories";
  26.  
  27. $conn = new mysqli($servername, $username, $password, $database);
  28.  
  29. if ($conn->connect_error) {
  30. die("Connection failed: " . $conn->connect_error);
  31. }
  32. echo "Connected successfully";a
  33.  
  34. function CloseCon($conn)
  35. {$conn -> close();}
Add Comment
Please, Sign In to add comment