That query shouldn't even work... you need to put strings in 'single quotes'
$query = mysql_query("SELECT * FROM autos WHERE category = 'autos' ORDER BY RAND() LIMIT 0,1 ");
Do this when running queries to test with:
$result = mysql_query ("SELECT * FROM table") or die (mysql_error());