Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. SELECT producto.id_producto, producto.nombre, producto.id_imagen,
  2. imagen.id_producto_imagen, imagen.url_imagen
  3.  
  4. FROM tabla_productos producto JOIN tabla_imagenes imagen
  5. ON producto.id_imagen = imagen.id_producto_imagen;
  6.  
  7. Array
  8. (
  9. [id_producto] => 1
  10. [0] => 1
  11. [nombre] => Iphone 6
  12. [1] => Iphone 6
  13. [id_imagen] => 1
  14. [2] => 1
  15. [id_producto_imagen] => 1
  16. [3] => 1
  17. [url_imagen] => P001.jpg
  18. [4] => P001.jpg
  19. )
  20.  
  21. Array
  22. (
  23. [id_producto] => 1
  24. [0] => 1
  25. [nombre] => Iphone 6
  26. [1] => Iphone 6
  27. [id_imagen] => 1
  28. [2] => 1
  29. [id_producto_imagen] => 1
  30. [3] => 1
  31. [url_imagen] => P001_1.jpg
  32. [4] => P001_1.jpg
  33. )
  34.  
  35. Array
  36. (
  37. [id_producto] => 1
  38. [0] => 1
  39. [nombre] => Iphone 6
  40. [1] => Iphone 6
  41. [id_imagen] => 1
  42. [2] => 1
  43. [id_producto_imagen] => 1
  44. [3] => 1
  45. [url_imagen] => P001_2.jpg
  46. [4] => P001_2.jpg
  47. )
  48.  
  49. FROM tabla_productos producto JOIN tabla_imagenes imagen
  50. ON producto.id_producto = imagen.id_producto_imagen;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement