I am using the below mentioned code to run cron job. I am running the cron job every minute. The cron file checks the whether there is a new data available for a particular user or not. If there is then just insert that into the database.
Problem I have checked in the SSH using tail -n 10 /var/log/cron command and it says that the cronjob ran a minute ago, which is great but it didn't entered the data in the database as there was a new data available. When I went directly on the URL it successfully added the data. Does anyone know what I might be doing wrong, any guidance will be great.
Cronjob Code
*/1 * * * * wget http://www.disciplinexgames.com/runkeeper/index.php >/dev/null 2>&1
PHP Code
$query = "Select * " .
"from data_feeds " .
"where username='mark@example.com' " .
"and gadget_data_type='Weighin' " .
"and gadget_data_type_id='3283123'";
$result = $dbCon->query($query);
//check if it is a new id..
if(mysql_num_rows($result) == 0){
//Insert into database..
}