Jump to content

Cron Job! Seems to be something wrong with my php


oracle765

Recommended Posts

/home/oracle765/public_html/scripts/masters.php: line 1: ?: No such file or directory

Use <?php rather than just <?

 

Actually, add this at the top of the script:

 

#!/usr/bin/env php

 

 

/home/oracle765/public_html/scripts/masters.php: line 3: syntax error near unexpected token `('

Line should be

mysql_select_db('mydatabase') or die('Could not select database.<br>' . mysql_error());

although I'm not sure why you're using an HTML tag there.

Link to comment
Share on other sites

To be able to run a file into a cron schedule make sure that the file has executable rights.

 

For the issue with .csv file, do you try to import the data from mysql command client line?

 

EDIT: What sql errors did you get running the script through the browser?

Link to comment
Share on other sites

I tried putting /usr/bin/php -f /home/username/public_html/scripts/masters.php in the cron job but then the emails stopped coming through

 

I also tried typing http://www.compareandchoose.com.au/scripts/masters.php in the browser and ti also did not load the data into the database but just shows a blank screen as there is no html output

 

I am so lost as to what it could be because those ` parenthesis around $dbH don't even exist in my code

Link to comment
Share on other sites

I tried putting /usr/bin/php -f /home/username/public_html/scripts/masters.php in the cron job but then the emails stopped coming through

 

I also tried typing http://www.compareandchoose.com.au/scripts/masters.php in the browser and ti also did not load the data into the database but just shows a blank screen as there is no html output

 

I am so lost as to what it could be because those ` parenthesis around $dbH don't even exist in my code

 

op are you sure your database credentials are correct

Link to comment
Share on other sites

What's the common b/w Apache and Cron? Cron could be run without php, mysql and apache at all. 

 

from OP

 

 

oh and I have tried running the webpage in the browser and when I go into the database it has not inserted the .csv file I have also put the full path in but that didn't work

 

 

 

I understood that the his query is faulty and doesn't generate the table values...

 

however mysql_error() should ouput if something is wrong, and its still blank page with no error.

 

Unless a new entry is inserted with blank values, then what I said above is irrelevant.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.