$query = "
SELECT r.proId, r.title, r.rating, r.review, p.name, p.pic1
FROM Review r
RIGHT JOIN Products p
ON r.proId = p.id
ORDER BY RAND() limit 1;";
Is there something wrong with this? I can't get any results back... And once i do, would i use something like
not sure if this would make any difference?:
A table reference may be aliased using tbl_name AS alias_name or tbl_name alias_name:
mysql> SELECT t1.name, t2.salary FROM employee AS t1, info AS t2
-> WHERE t1.name = t2.name;
also (not a bug, but recommended):
RIGHT JOIN works analogously as LEFT JOIN. To keep code portable across databases, it's recommended to use LEFT JOIN instead of RIGHT JOIN.
Not sure what you mean by 'I can't get any results back', does the query not return the results you want or does it just not work at all, ie. show an error?
For error checking make sure that you use mysql_error():