Results 1 to 1 of 1
  1. #1
    Join Date
    May 2011
    Location
    The Netherlands
    Posts
    4
    Plugin Contributions
    0

    Default problem running cron plugin currency_update.php

    When I downloaded the plugin to update the currency exchange rates using cron I noticed it was throwing errors when I tested by running it manually. I was able to solve it by replacing (line 29 - 37):

    # Get default currency.
    $row=$mysqli->query("select configuration_value from " . TABLE_CONFIGURATION .
    " WHERE configuration_key='DEFAULT_CURRENCY' LIMIT 1 ")->fetch_row();
    define('DEFAULT_CURRENCY', $row[0]);

    #Get currency conversion ratio.
    $row=$mysqli->query("select configuration_value from " . TABLE_CONFIGURATION .
    " WHERE configuration_key='CURRENCY_UPLIFT_RATIO' LIMIT 1 ")->fetch_row();
    define('CURRENCY_UPLIFT_RATIO', $row[0]);


    into:

    # Get default currency.
    $p = $mysqli->query("select configuration_value from " . TABLE_CONFIGURATION .
    " WHERE configuration_key='DEFAULT_CURRENCY' LIMIT 1 ");
    $row = $p->fetch_row();
    define('DEFAULT_CURRENCY', $row[0]);

    #Get currency conversion ratio.
    $p = $mysqli->query("select configuration_value from " . TABLE_CONFIGURATION .
    " WHERE configuration_key='CURRENCY_UPLIFT_RATIO' LIMIT 1 ");
    $row = $p->fetch_row();
    define('CURRENCY_UPLIFT_RATIO', $row[0]);


    It might got to do with my php version being a bit old (4.4.8) but if you encounter trouble getting it to work you might want to consider this...


    regards,
    Rob Musquetier
    The Netherlands
    Last edited by Rob Musquetier; 23 May 2011 at 09:50 PM. Reason: added used php version

 

 

Similar Threads

  1. v154 Any good advice on adding PHP Cron Jobs?
    By SpaceMonkey in forum General Questions
    Replies: 19
    Last Post: 4 Dec 2015, 12:30 AM
  2. Can I run Backup MYSQL Plugin v1.4 via cron job?
    By Renz in forum General Questions
    Replies: 2
    Last Post: 23 Mar 2012, 06:25 AM
  3. simple cron and application_top.php
    By atozstore in forum General Questions
    Replies: 4
    Last Post: 30 Jan 2012, 04:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg