I'm stumped as to why this might be happening. A website I had completed for a client over a year ago, was working fine until a couple of days ago when the web host went and moved the site onto a new server without warning any of their customers (myself included). This caused errors with the database connections etc., but that was all easily fixed.
Now something strange is happening though - one of my bigger INNER JOIN queries (which was working fine) is suddenly returning empty results. I had a quick search and found that this was happening for some people on a certain version of MySQL (the same one the new server was running, 5.1.49), so I had the web host update the MySQL but it hasn't changed anything.
Is there something obvious that I'm missing here - perhaps a syntax error or some old method I'm using which is no longer supported in MySQL 5.1+?
$subcat_products_lookup = mysql_query('SELECT DISTINCT pclook.product_id, pclook.category_id, prod.name AS prod_name, prod.id, prod.enabled, prod.sku, prod.brand, prod.range, prod.wels_rating, prod.image_filename_1, range.id AS range_id, range.name AS range_name, brand.id AS brand_id, brand.name AS brand_name FROM product_category_lookup pclook INNER JOIN products prod on pclook.product_id = prod.id INNER JOIN ranges range on prod.range = range.id INNER JOIN brands brand on prod.brand = brand.id WHERE (pclook.category_id = "'.$subcat_id.'" AND prod.enabled = "yes" AND prod.brand != "6") ORDER BY prod.rank asc, prod.name asc');