New to PHP and need some help with errors?

Wondering what’s going on with your variables? Not seeing what you are expecting? If you are a newbie learning PHP, one of the most useful functions to know is var_dump(). It dumps the contents of a variable, so you can see it in your web browser, it’s simple to use for example: var_dump($my_variable); Then you […]

How to join three MySQL database tables together in a simple SELECT statement

Following on from my post of how to join two MySQL tables together, adding a third table is just as easy, but if you need an example this one extends the previous post by adding a third table. For example I have a table of products, table of product categories and table of product suppliers, […]

Still using the old MySQL driver? What you need to know about MySQLi…

Its time to upgrade from the PHP MySQL extension The PHP MySQL extension was deprecated in PHP 5.5.0! You should upgrade your code to use MySQLi at least, even better would be upgrading to PDO. This post about selecting data uses PDO and has the full source code available for you. But back to MySQLi […]

How to use Google Charts together with PHP

If you are looking to add charts to your PHP pages and haven’t already checked out Google Charts, I recommend you do, I’ve used them in a number of projects to great effect. Features & Benefits: They are free HTML5 / SVG  based for cross-browser compatibility Well documented Lots of examples in the Chart Gallery, […]

4 Free PHP PDF Libraries you can use to convert HTML to PDF

Use any of these 4 libraries below to easily covert your HTML to PDF files with PHP. I’ve always used TCPDF for converting HTML, including JPEG and SVG images into PDF files, which you can download inline in the browser, save on the server or force a “save as” dialog. Free PDF – http://www.fpdf.org/ TCPDF – http://www.tcpdf.org/ […]

How to join two MySQL database tables together in a simple SELECT statement

How to join two MySQL database tables together in a simple SELECT statement? For example I have a table of products and a table of product categories, how to return the category description of each product? Products ———– id category_id product_name Categories ————- id description A. In it’s simplest form you would join two tables […]

How do you include frequently used code in another PHP file?

Q. How do you include PHP files in other PHP files? – Useful for including your database connection across all pages that need it. – If you have written some functions once and want to reference them in other pages. – Also commonly used to keep consistent header and footer parts of your pages, by […]