Jump to content

Metonmuris

Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://www.meton.net/

Profile Information

  • Gender
    Not Telling

Metonmuris's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I have access to cron.. So I guess the best way would be to tell it to update the files at 2:00am/2:00pm instead of whenever the data get's updated. That's not that bad of an idea, thanks.
  2. I have created some GD2 generation scripts that only need to be updated everyonce an while, and because they can take some heavy cpu time I would only like them to run when they have changed and not whenever any visits the image. So I set up a script that calls all of the graphics generators as functions and logs the result (Success/Fail) into a log database. [code=php:0]$doPieGraph = 0; $doPieGraph = $_GET['piegraph']; include("../../jpgraph/jpgraph.php"); include("../../jpgraph/jpgraph_bar.php"); include("../displays/graph_utilities"); include("../displays/killratio_chart.php"); include("../displays/killratio_map.php"); include("../displays/killratio_piechart.php"); include('../../config/mysqlvars.php'); $query = array(); if(DrawKRMap($mysqlvars)) { array_push($query, "INSERT INTO `log` ( `id` , `log_id` , `timestamp` , `error_lvl` , `info` ) VALUES ('0', '100', NOW( ) , '0', 'Kill Ratio Map Successfully Updated');"); echo "true KRMAP <br/>"; } else { array_push($query, "INSERT INTO `log` ( `id` , `log_id` , `timestamp` , `error_lvl` , `info` ) VALUES ('0', '100', NOW( ) , '1', 'Kill Ratio Map ERROR');"); echo "false KRMAP <br/>"; } if(DrawKRGraph($mysqlvars, '../../assets/graphs/killVdeath.png')) { array_push($query, "INSERT INTO `log` ( `id` , `log_id` , `timestamp` , `error_lvl` , `info` ) VALUES ('0', '101', NOW( ) , '0', 'Kill Ratio Chart Successfully Updated');"); echo "true KRCHART <br/>"; } else { array_push($query, "INSERT INTO `log` ( `id` , `log_id` , `timestamp` , `error_lvl` , `info` ) VALUES ('0', '101', NOW( ) , '1', 'Kill Ratio Chart ERROR');"); echo "false KRCHART <br/>"; } if($doPieGraph == 1) { if(DrawKRPieChart($mysqlvars)) { array_push($query, "INSERT INTO `log` ( `id` , `log_id` , `timestamp` , `error_lvl` , `info` ) VALUES ('0', '102', NOW( ) , '0', 'Kill Ratio Pie Graph Successfully Updated');"); echo "true KRPIE <br/>"; } else { array_push($query, "INSERT INTO `log` ( `id` , `log_id` , `timestamp` , `error_lvl` , `info` ) VALUES ('0', '102', NOW( ) , '1', 'Kill Ratio Pie Graph ERROR');"); echo "false KRPIE <br/>"; } } $link = mysql_connect($mysqlvars['host'], $mysqlvars['user'], $mysqlvars['pass']); mysql_select_db($mysqlvars['db']); for($i =0; $i < count($query); $i++) { mysql_query($query[$i]); } mysql_close($link); echo "??????"; [/code] Now the scripts works when dealing with DrawKRMap(), but as soon as it gets to DrawKRChart() is stopped outputting the debug echos and ends like it worked. This is more or less the result that the DrawKRChart() uses JpGraph, whereas DrawKRMap() is straight GD2. This doesn't work, so I am sitting here scratching my head trying to figure out how to do this, then I though why not do a CLI operation... Well that doens't work either, because I don't have access to it on my host  >:( So my question is there a way to get php to poke/fork another php file in the same way a user would by visiting that php page without using system or php-cli.
  3. How do you get the total number of entries from a Mysql table. Im not totally sure on the SQL to do such a thing.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.