Hi,
I'm attempting to run a PHP script using a Cron job, which imports a csv file into a mysql database.
I initially scheduled them to run within crontab but they were never performed.
I've tested to ensure PHP is set up correctly and that cron is really running.
When I've attempted to run them using the command line:
/usr/bin/php -q /home/linweb01/t/tduk-solutions.co.uk/user/htdocs/response/insert.php
But this doesn't seem to run anything and just moves to the next line.
I've also attempted a simple database connection but this again just moves the cursor.
The php script itself is run fine from the browser and within putty I'm able to run a script that simply displays text to the screen but any sort of database connection and i get no response.
Are there any additional commands i need to included within the PHP script to ensure that this runs?
My Db connections is as follows:
Let me know if this should be posted in another forum.
Thanks in advance.
I'm attempting to run a PHP script using a Cron job, which imports a csv file into a mysql database.
I initially scheduled them to run within crontab but they were never performed.
I've tested to ensure PHP is set up correctly and that cron is really running.
When I've attempted to run them using the command line:
/usr/bin/php -q /home/linweb01/t/tduk-solutions.co.uk/user/htdocs/response/insert.php
But this doesn't seem to run anything and just moves to the next line.
I've also attempted a simple database connection but this again just moves the cursor.
The php script itself is run fine from the browser and within putty I'm able to run a script that simply displays text to the screen but any sort of database connection and i get no response.
Are there any additional commands i need to included within the PHP script to ensure that this runs?
My Db connections is as follows:
Code:
<?php
$db_host = "X.X.X.X";
$db_name = "DB_name";
$db_username = "user";
$db_password = "user01";
$connection = @mysql_pconnect($db_host, $db_username, $db_password) or die("Unable to make connection to database server $db_host");
@mysql_select_db($db_name, $connection) or die("Unable to find database $db_name");
?>
Let me know if this should be posted in another forum.
Thanks in advance.