Support » Plugin: Exec-PHP » PHP not giving correct results

  • Hi, I am trying to get Exec-PHP to work, in testing I tried just a test global code that you can use to make sure your php is working.

    $a = 1;
    $b = 2;
    function Sum()
        $GLOBALS['b'] = $GLOBALS['a'] + $GLOBALS['b'];
    echo $b;

    Everywhere else the answer is 3 of course, but for some reason when I run it through on my WordPress site using Exec-PHP it is giving me the answer of 2.

    Eventually I would like to run table data from a MySQL but if it is not even giving me the right answer for a generic global…I am not sure where the problem is.

  • The topic ‘PHP not giving correct results’ is closed to new replies.