title: How can I get my cron job working in cpanel?
body: <p>I need to automate a couple things for my website, one of them being having the database cleared at midnight every night. I looked at cron job tutorials and came up with a script</p>
  
  <pre><code>&lt;?php 
  $con = mysqli_connect("localhost", "root", "password", "test");
  $sql = "DELETE FROM markers";
  $con-&gt;exec($sql);
  echo "Record deleted successfully";
  $con = null;
  
  INSERT INTO `markers` (`name`, `lat`, `lng`, `id`, `questTitle`, `questReward`, `category`, `date_submitted`) VALUES ('Marker1', 41.2952, -92.644, 1, NULL, NULL, NULL, NULL);
  </code></pre>
  
  <p>this just wipes the database and re-inserts records with empty values to be modified throughout the day.</p>
  
  <p>I tried setting up a cron job to run this at midnight using cpanel, my path is</p>
  
  <pre><code>/usr/bin/php /home/user/public_html/command.php
  </code></pre>
  
  <p>I have the command.php in my uploaded web files and set the job to run every 30 mins to test it, but no matter what I do I cannot seem to get it to work. </p>