I've got this chunk of code (included) that used to work fine in a script up until a couple of weeks ago. Nothing has changed in the php page at all, it just quit working. If I take this chunk of code and place it alone in a php script it works just fine, but only by itself. I don't understand what's going on and don't see anything that would make the script seem like it's just skipping this chunk of code, without errors, when I run it. I'm using PHP 4.4.4-8 mand MySQL 5.0.32 on Debian Etch.

The code does use nested MySQL queries, it worked before but I thought maybe something changed in PHP or MySQL recently in updates that might have broken it, but there is another chunk of code in the script that uses nested queries as well that works fine just as it had been.

I also have another script that has recently broke and seems to skip a section of code as well without errors. There are no real similarities between the two that I can see.

Thanks,

Ed


//DO COUNTY BY COUNTY SORTED REPORTS (SORTED BY CITY,PRICE)

echo "Starting Standard County By County Reports<br>";

mysql_connect ($local_host, $local_user, $local_pass); $result = mysql_query ("SELECT countyname FROM ehs.tempinventorycounties ORDER BY countyname ASC");

if ($row = mysql_fetch_array($result)) {

   do {

       $currentcounty = $row['countyname'];

       echo "Generating Report for $currentcounty County<br>";

       $ap = fopen("$report_path/$currentcounty$issue.txt", "w");

$result2 = mysql_query ("SELECT * FROM ehs.tempinventory WHERE county = '$currentcounty' AND property_type NOT LIKE 'Commercial' AND property_type NOT LIKE 'Land & Lots' ORDER BY city,price DESC");

       if ($row2 = mysql_fetch_array($result2)) {

           do {

               fputs($ap, $row2['mls']);
               fputs($ap, $nl);
               fputs($ap, $row2['city']);
               fputs($ap, $sp);
               fputs($ap, $dol);
               fputs($ap, number_format($row2['price']));
               fputs($ap, $nl);
               fputs($ap, $row2['beds']);
               fputs($ap, $sp);
               fputs($ap, "Bedroom");
               fputs($ap, $sp);
               fputs($ap, $row2['baths']);
               fputs($ap, $sp);
               fputs($ap, "Bath");
               fputs($ap, $nl);
if ($row2['garage'] != "None") { $garage_type = explode(" ", $row2['garage']);

                   $garage_show = $garage_type[1] . " " . $garage_type[2];

                   fputs($ap, $garage_show);
} else {

                   fputs($ap, $row2['garage']);

               }

               fputs($ap, $sp);
               fputs($ap, $row2['squarefeet']);
               fputs($ap, $sp);
               fputs($ap, "SF");
               fputs($ap, $nl);
               fputs($ap, "MLS#");
               fputs($ap, $row2['mls']);
               fputs($ap, $nl);
               fputs($ap, $row2['phone']);
               fputs($ap, $nl);
               fputs($ap, "Email: ");
               fputs($ap, $row2['email']);
               fputs($ap, $nl);
               fputs($ap, $row2['company']);
               fputs($ap, $sp);
               fputs($ap, $row2['agent']);
               fputs($ap, $nl);
               fputs($ap, $nl);
//COPY LISTING IMAGE TO INVENTORY IMAGES

               $path = $row2['path'];
               $image = $row2['image'];

               exec ("cp -p $path/listings/$image $image_path/$image");

               //COPY AGENT IMAGE TO INVENTORY AGENT IMAGES

               $agent_image = $row2['agent'];
               $agent_image = str_replace(" ", "_", $agent_image);
               $agent_image = $agent_image . ".jpg";

exec ("cp -p $path/agents/$agent_image $agent_path/$agent_image");

           }
           while ($row2 = mysql_fetch_array($result2));

}
       fclose($ap);

   }

   while ($row = mysql_fetch_array($result));

}

mysql_close();


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to