Warning: Trying to access array offset on value of type bool in /var/www/vhosts/tomelliott.com/httpdocs/wp-content/themes/tomelliott/archive.php on line 14

PHP / SQL posts

Duplicating a MySQL table

An SQL statement that allows one table to easily be duplicated in MySQL. Also describes table duplication in PHPMyAdmin

Duplicate a MySQL table »


Warning: Trying to access array offset on value of type bool in /var/www/vhosts/tomelliott.com/httpdocs/wp-content/themes/tomelliott/archive.php on line 14

Get longitude & latitude values with Google Maps API using PHP

Some handy PHP code to get the longitude and latitude values from Google Maps API, based on the town, city or country location.

Get latitude and longitude using Google Maps »

PHP highlight keyword in string and maintain capitalisation

A PHP function that will highlight all matched keywords in a text string, whilst maintaining correct capitalisation. Examples given and code explained

Highlight keyword in PHP string »

Enabling mod_rewrite on Windows Apache for URL rewriting

A tutorial demonstrating how to enable mod_rewrite which will allow a website running on a WAMP stack to use a local .htaccess file for URL rewriting.

Activate mod_rewrite on WAMP »

Tweet Caching with PHP & JQuery

Part 2 of the custom twitter feed tutorial with authentication. Caching the twitter feed to a local file can speed up loading of tweets and negate Twitters rate limiting.

Twitter feed caching »

Scheduled Task for PHP scripting in Plesk & Linux

A tutorial for setting up a scheduled task using Plesk 11 on Linux. A couple of steps are involved for the scheduled script; ensuring Access to the server over SSH is specified and using wget utility to run the PHP script.

Scheduling a PHP script from Plesk »

Authenticating a Twitter Feed for OAuth API V1.1 – Timelines & streams

A tutorial designed to help anyone who is using or wants to create a custom Twitter feed that needs to authenticate basic read-only access for any public user timeline with Twitter OAuth, API V1.1.

Authenticate a Twitter feed with OAuth »


Warning: Trying to access array offset on value of type bool in /var/www/vhosts/tomelliott.com/httpdocs/wp-content/themes/tomelliott/archive.php on line 14

Indexing MySQL fields to speed up PHP queries

Indexing database fields can do wonders to speed up complex PHP queries. This post goes shows how easy it is to know where to use indexes and how, using MySQL, PHP and PHPMyAdmin.

Speed up PHP through MySQL indexing »


Warning: Trying to access array offset on value of type bool in /var/www/vhosts/tomelliott.com/httpdocs/wp-content/themes/tomelliott/archive.php on line 14

PHP function: calculate x seconds, minutes or hours ago

A useful Twitter style PHP time interval function to calculate the difference in seconds, minutes, hours or days between two different dates and times. The function can be used to display seconds, minutes or hours only, or display the most relevant time measurement unit automatically.

PHP time interval function »


Warning: Trying to access array offset on value of type bool in /var/www/vhosts/tomelliott.com/httpdocs/wp-content/themes/tomelliott/archive.php on line 14

PHP get first paragraph from a string function

A useful PHP function that gets the first paragraph from a regular HTML string, with option to remove the paragraph tags.

Get first paragraph function in PHP »