I have a problem where PHP is not Echoing things until it's gotten through a ton, it not all of the queries in a loop. Shouldn't it echo "inline"? Anyone had a weird problem like this?
I have an ungodly slow program that times out and is making my life miserable. I've included some code below. I've tried to utilize the LOW_PRIORITY command in an effort to speed things up by minimizing writes.
$IDS is a 6000 element array.
Somehow I'm Fucking this up. I need insight.
I have an ungodly slow program that times out and is making my life miserable. I've included some code below. I've tried to utilize the LOW_PRIORITY command in an effort to speed things up by minimizing writes.
$IDS is a 6000 element array.
Somehow I'm Fucking this up. I need insight.
PHP:
foreach($IDS as $ID)
//for($i=0;$i<10;$i++)
{
$query = "SELECT products_id FROM ch_products WHERE xref1 = '$ID' LIMIT 1;";
//echo $query;
$res = mysql_query($query) or die(mysql_error());
if(!$idarray = mysql_fetch_array($res))
{
echo "$ID Not in CH Database<br>";
mysql_query("DELETE LOW_PRIORITY FROM Horizon.Products WHERE ID = '".$ID."' LIMIT 1;") or die(mysql_error());
continue;
}
echo "Nuking..".$idarray['products_id']."<br>";
if (!is_object($db)) {
//PHP 5.2.0 bug workaround ...
$db = new queryFactory();
$db->connect("localhost", "", "", "cart", USE_PCONNECT, false);
}
zen_remove_product($idarray['products_id']);
mysql_query("DELETE LOW_PRIORITY FROM Horizon.Products WHERE ID = '".$ID."' LIMIT 1;") or die(mysql_error());
}