corsasport.co.uk
 

Corsa Sport » Message Board » Off Day » Geek Day » PHP Geeks.... » Post Reply

Post Reply
Who Can Post? All users can post new topics and all users can reply.
Icon:
Formatting Mode:
Normal
Advanced
Help

Insert Bold text Insert Italicized text Insert Underlined text Insert Centered text Insert a Hyperlink Insert Email Hyperlink Insert an Image Insert Code Formatted text Insert Quoted text
Message:
HTML is Off
Smilies are On
BB Code is On
[img] Code is On
Post Options: Disable smileys?
Turn BBCode off?
Receive email notification of new replies?

Dom

posted on 27th Apr 15 at 19:45

As Ian has mentioned, you need to look at the updatePurchaseOrderTotals() function to see what's actually being done with the query results.


Ian

posted on 27th Apr 15 at 18:45

Yes although it is calling a function updatePurchaseOrderTotals() which may be doing more.


Bart

posted on 27th Apr 15 at 18:42

I need to update a number of order totals within a DB and have been given this code to look at:

quote:

<?php
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$start = $time;

$sql = "SELECT id FROM purchaseorder WHERE datecreated > DATE_SUB(CURDATE(), INTERVAL 2 YEAR)";
$result = mysql_query($sql) or die(mysql_error());
while($row = mysql_fetch_array($result)) {
echo "Update Purchase Order: " . $row["id"] . "<br/>";
updatePurchaseOrderTotals($row["id"]);
}

$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$finish = $time;
$total_time = round(($finish - $start), 4);
echo 'Update Time : '.$total_time.' seconds.';
?>



Now im not a PHP/Coding person, but the above doesn't appear to be updating anything, from what I can see its searching for orders with a created date of a 2 year period and simply echo'ing them on the page.

Is that correct or have I mis-understood the code?

[Edited on 27-04-2015 by Bart]