What I want to do is a PHP script that gets all the products of a Joomla VirtueMart using PHP and mySQL. However my question has nothing to do about Joomla or PHP but I am in the need of a mySQL query.
Below you can find the tables and the fields that holds the data I need which are
product_id, product_desc, product_full_image, product_name, product_price, category_name.
To get the product_price you will need the product_id from jos_vm_product and match it with the product_id from jos_vm_product_price to get the product_price.
Every product_id has a category_id inside jos_vm_product_category_xref. So, when the category_id is found, you get the category_name from jos_vm_category.
This is difficult for me as I am not very familiar with SQL queries and I need your help on how to to join those tables, so it will allow me to echo the values I need.
Thank you.
jos_vm_poduct
product_id
product_desc
product_full_image
product_name
jos_vm_product_price
product_id
product_price
jos_vm_product_category_xref
product_id
category_id
jos_vm_category
category_id
categroy_name
Something like this ought to work:
Any questions about why, please ask away!