If your query is bringing back duplicate rows from your database then that is where you should be looking first in order to eliminate them.
See if you can do this using the mysql DISTINCT keyword or something:
$query = "SELECT users.user_id
FROM users, prices, car_desc
WHERE prices.car_desc_id LIMIT 0, 30 ";
I reformatted your query so it is easier to read and understand for others.
I think the problem lies in you doing joins but not doing so implicitly with JOIN statements.
You could ask to have this moved to the sql forum, using PHP to remove the duplicates is not the way to go about this.