Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

SitePoint PHP Blog:
A Comprehensive Guide to Using Cronjobs
Mar 31, 2016 @ 12:18:47

If you've ever wanted to learn about cron jobs, how to set them up and what kind of functionality they provide then the SitePoint PHP blog has the post for you. In this comprehensive guide to cron you learn about these topics and more.

There are times when there’s a need for running a group of tasks automatically at certain times in the future. These tasks are usually administrative, but could be anything – from making database backups to downloading emails when everyone is asleep. [...] This article is an in-depth walkthrough of this program, and a reboot of this ancient, but still surprisingly relevant post.

They start by going through some of the basic terminology and syntax, where the cron files live and what a typical file format looks like. Also included are instructions on:

  • how to edit the cron correctly (crontab)
  • the structure of each cron entry
  • how to have it run at the time you want
  • editing another user's crontab
  • cron permissions
  • redirecting output

They also talk about executing PHP in a cron job, how to prevent overlaps with a "lock" file . There's also a mention of Anacron as a replacement for cron and a few helpful hints to help you debug when things go wrong.

tagged: cron cronjob tutorial comprehensive guide configuration execution

Link: http://www.sitepoint.com/a-comprehensive-crash-course-into-cronjobs/

Kevin Waterson's Blog:
Introduction to PHP and MySQL How they work together.
Sep 12, 2008 @ 10:08:59

Kevin Waterson has posted a new tutorial (a very comprehensive one) seeking to make introductions between a developer new to PHP and the MySQL abilities the language has.

This tutorial is aimed at those new to PHP and MySQL. The object of this tutorials is to show by way of example how to use php to CREATE a database, how to CREATE a table, how to INSERT data into a database, and how to SELECT that data and display it on a web page.

The tutorial doesn't get into working with forms and the data submitted in them, but it does give a great overview of basic SQL commands, pushing data into tables and some other simple functions (loading a CSV file, preventing SQL injection and getting the last inserted ID).

tagged: tutorial introduction mysql comprehensive csv lastid injection sql