I have an SQL query like this. When iam executing it though my php file it gives time out error. But when running the same query thoruhg php myadmin it gives results within seconds.
SELECT
cake_apartments.id,
cake_apartments.Headline,
cake_apartments.Description,
cake_apartments.photoset_id,
cake_apartments.Rental_Price,
cake_apartments.Bedrooms,
cake_apartments.Bathrooms
FROM
cake_apartments,cake_neighborhoods
WHERE
(cake_apartments.Rented = 0)
AND
(cake_apartments.status = 'Active')
ORDER BY
cake_neighborhoods.Name DESC
I know that increasing the time out may solve the problem. but i don't want to spend more than 30 sec for this query.