Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT producto.id_producto, producto.nombre, producto.id_imagen,
- imagen.id_producto_imagen, imagen.url_imagen
- FROM tabla_productos producto JOIN tabla_imagenes imagen
- ON producto.id_imagen = imagen.id_producto_imagen;
- Array
- (
- [id_producto] => 1
- [0] => 1
- [nombre] => Iphone 6
- [1] => Iphone 6
- [id_imagen] => 1
- [2] => 1
- [id_producto_imagen] => 1
- [3] => 1
- [url_imagen] => P001.jpg
- [4] => P001.jpg
- )
- Array
- (
- [id_producto] => 1
- [0] => 1
- [nombre] => Iphone 6
- [1] => Iphone 6
- [id_imagen] => 1
- [2] => 1
- [id_producto_imagen] => 1
- [3] => 1
- [url_imagen] => P001_1.jpg
- [4] => P001_1.jpg
- )
- Array
- (
- [id_producto] => 1
- [0] => 1
- [nombre] => Iphone 6
- [1] => Iphone 6
- [id_imagen] => 1
- [2] => 1
- [id_producto_imagen] => 1
- [3] => 1
- [url_imagen] => P001_2.jpg
- [4] => P001_2.jpg
- )
- FROM tabla_productos producto JOIN tabla_imagenes imagen
- ON producto.id_producto = imagen.id_producto_imagen;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement