Advertisement
Guest User

Untitled

a guest
Feb 28th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. <?php
  2. $connect = mysqli_connect('localhost', 'olegmowk_1', '1425pmrmsw', 'olegmowk_1');
  3. if ($connect == false) {
  4. echo "Error connect";
  5. }
  6.  
  7. $result = mysqli_query($connect, "
  8. SELECT categories.title, goods.name
  9. FROM categories
  10. INNER JOIN goods
  11. ON categories.id = goods.category
  12. ORDER BY categories.id;
  13. ");
  14.  
  15. while ( ($cat = mysqli_fetch_assoc($result)) ) {
  16. echo $cat['title'];
  17. echo " = ";
  18. echo $cat['name'];
  19. }
  20.  
  21. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement