I’m using MySQL 5 & PHP 5 with FastCGI Support enabled on the domain, trying to use the control panel to run a cron job that will call a stored procedure I made in MySQL (host=mysql.rhanchronicles.com, DB=rcjoom, SP= sp_SeedDetail, when I call it in Query Browser it works just fine). The procedure needs no parameters supplied (it just inserts values from one table into various other tables). I’ve tried several things (most detailed below) but I cannot see any results in the MySQL table I’m inserting into, and I don’t even get any e-mails regarding the Cron Job. I’m new to everything here, so forgive my ignorance. . .
I was hoping that I could put everything in the “Cammand to run” field, but I don’t know if this is supported. I tried this (I put actual username & password, which have been starred out here):
usr/bin/mysql -u ****** -p******* -h mysql.rhanchronicles.com rcjoom call rcjoom.sp_SeedDetail()
However, nothing happens with that. I then tried to create a php script to call the procedure. I named the file, “SeedGameCharDetail.php,” put it into a new folder, and entered this into the “Command to run” field in the Cron Job control panel screen.
Or. . .
The script in the file was:
$user = "******";
$pass = "******";
$dbh = new PDO('mysql:host=mysql.rhanchronicles.com;dbname=rcjoom', $user, $pass);
$stmt = $dbh->prepare("CALL sp_SeedDetail()");
// call the stored procedure
I came up with these scripts, etc. from reviewing the various DH wiki articles on Cron, searching the web for PHP examples, etc., and trying to adapt them to my needs.
I did check that there were no hard line breaks in the “Command to run” field, and that there were less than 100 characters including spaces. I’ve even tried a few different approaches, but they either did not work or I could not find an example of the script on the Internet that I knew how to adapt to my needs. I may be missing something very simple here, but I’ve sunk at least a handful of hours into this problem already and I’m running out of ideas. I’d greatly appreciate it if someone can provide some guidance or point out where I’ve made a misstep.