Re: Time-out problem
2 million rows is not a lot.
But (i) executing a new query for every value found in your first query is a waste of resources. You could easily do it with one query, and (ii) the mysql API has been deprecated and will disappear, you need to use mysqli ...
$conn = mysqli_connect(...);
$res1 = mysqli_query($conn,'select id_campaign from spd_campaign');
$ids = array();
while( $row=mysqli_fetch_row($res1) ) $ids[] = $row;
$sid = implode( ",", $ids );
$qry="
select fk_id_ad_format
from spd_unit
join spd_ad on fk_id_ad=id_ad
where fk_id_campaign in($isid)
group by fk_id_ad_format";
$res2=mysqli_query($conn,$qry);
Then retrieve & display the result as desired.
Subject
Written By
Posted
Re: Time-out problem
April 23, 2014 09:57AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.