Query Multiple SQL Tables
I need to query values in more than one table and ensure the results are
displayed correctly.
Each table has the unique product_id within, but how do I ensure the data
lines up correctly? For example, product_price is queried from a different
table and needs to be aligned with the correct product.
I'm new to SQL so apologies if this is an easy one.
Rob.
$query = "SELECT * FROM jos_vm_product ORDER BY product_publish DESC";
$result = mysql_query($query);
echo ""; while($row = mysql_fetch_array($result)){
echo "" . $row['product_id'] . "" . $row['product_sku'] . "" .
$row['product_name'] . "" . $row['product_in_stock'] . "" .
$row['product_sales'] . "" . $row['product_price'] . "" .
$row['product_available_date'] . "" . $row['product_publish'] . "";
}
echo "";