bakes Report post Posted October 21, 2008 Below is my PHP script that generates the daily PV from our AS400 but it wont work when I use the echo "&value=".$PV; line. Howerver if I comment it out and use the echo "&value=".$num; (which is just a random number) it works just fine. I looked at the page source for both its only 1 line long and everything looks fine. Any ideas? <?php require_once('../../Connections/dpsas400.php'); ?><?php $date=date('Ymd'); $bfdrtpvq="SELECT SUM(LQORD*LNET) as NetBook FROM ECL WHERE LODTE='".$date."' and LICFAC='010'"; $bfdrtpvr = odbc_exec($as400, $bfdrtpvq); $bfdrtpvq2="SELECT SUM(c.UNITCOST*e.LQORD) as Cost FROM ECL e LEFT JOIN CMFV0300 c on e.LPROD=c.CFPROD and e.LICFAC=c.CFFAC WHERE e.LODTE='".$date."' and e.LICFAC='010'"; $bfdrtpvr2 = odbc_exec($as400, $bfdrtpvq2); $NetBook = odbc_result($bfdrtpvr, 'NetBook'); $Cost = odbc_result($bfdrtpvr2, 'Cost'); $PV = (($NetBook-$Cost)/$NetBook)*100; $num = rand(0,100); odbc_close($as400); //echo "&value=".$num; //echo "&value=".$NetBook; $disp = "&value=".$PV; echo $disp; //echo "&value=".$Cost; ?> Share this post Link to post Share on other sites
bakes Report post Posted October 21, 2008 Well I had to lower my refresh interval. Guess 1 second wasnt long enough for it to run the sql and make the page =) Share this post Link to post Share on other sites