- 25 Tem 2013
- 76
- 0
Merhaba arkadaşlar veri çekimi yaparken site çok ağır kalıyor yaklaşık 150 sorguyu 2-3 dakikada yapıyor aynı script farklı kodlama ile değiştiren arkadaşım 2 -3 binlik sorguyu 1 kaç saniyede yapıyor nasıl hızlandırabilirim öneriniz var mı ?
sql yapısı böyle
<?
if ($_GET["action"] == "send")
{
$favid = cs($_POST["favid"]);
$say = cs($_POST["say"]);
// Datadan kullanıcı çekiliyor
$a = mysql_query("select * from users where gold='0' order by rand() limit ".$say."");
$i=0;
while ($b = mysql_fetch_array($a))
{
$oauth_token[$i] = $b["oauth_token"];
$oauth_secret[$i] = $b["oauth_secret"];
$i++;
}
for ($i=0;$i<$say;$i++) {
fav($oauth_token[$i],$oauth_secret[$i],$favid);
}
flush();
$sondurum = '<div class="success grid_12"><h3>'."<center><br><font color=green>İşlem tamamlandı.</font></center><br><br></center>".'</h3><a href="#" class="hide_btn"> </a></div>';
// ----------------------------
}
?>
sql yapısı böyle
<?
if ($_GET["action"] == "send")
{
$favid = cs($_POST["favid"]);
$say = cs($_POST["say"]);
// Datadan kullanıcı çekiliyor
$a = mysql_query("select * from users where gold='0' order by rand() limit ".$say."");
$i=0;
while ($b = mysql_fetch_array($a))
{
$oauth_token[$i] = $b["oauth_token"];
$oauth_secret[$i] = $b["oauth_secret"];
$i++;
}
for ($i=0;$i<$say;$i++) {
fav($oauth_token[$i],$oauth_secret[$i],$favid);
}
flush();
$sondurum = '<div class="success grid_12"><h3>'."<center><br><font color=green>İşlem tamamlandı.</font></center><br><br></center>".'</h3><a href="#" class="hide_btn"> </a></div>';
// ----------------------------
}
?>