Advertisement
Guest User

Untitled

a guest
Oct 28th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. //conection to database//
  2.  
  3.  
  4. $con = mysqli_connect ("localhost", "root", "","redlynx");
  5.  
  6.  
  7. //geting colors//
  8.  
  9. function getColors(){
  10. global $con;
  11.  
  12. $get_colors =" select * from colors";
  13.  
  14. $run_colors = mysqli_query ($con,$get_colors);
  15.  
  16.  
  17. while ($row_colors=mysqli_fetch_array ($run_colors)){
  18. $colors_id=$row_colors ['colors_id'];
  19. $colors_title=$row_colors ['colors_title'];
  20.  
  21. echo "<li><a href='#' >$colors_title</a></li>";
  22. }
  23. }
  24.  
  25. <?php
  26. include ("functions/functions.php");
  27. ?>
  28.  
  29. <?php
  30. get_colors ();
  31. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement