JOIN to get results from 2 tables

Using JOIN to get results from two tables This is PHP4 Code! Example 1 Example 2 Using JOIN to get results from three tables This is PHP4 Code! Example 1 Using GROUP BY To Get One Row Per Match This is PHP4 Code! Note – when using GROUP BY, if you also use ORDER BY […]

Read More →

Reload page

Reload the current page Form reloads current page Link reloads current page Reload current page but with post values stripped Using javascript Periodic Refresh

Read More →

.UPDATE general

Object Oriented Style How many rows were affected Procedural Style Maths Operations In Update Queries Add text to an existing text field

Read More →

Columns Data Types

Quick Data Types List (For a more in depth description see below) Numeric BOOL Use TINYINT BIT The BIT data type is used to store bit-field values. A type of BIT(M) enables storage of M-bit values. M can range from 1 to 64.  (Not universally supported) INT A normal-sized integer that can be signed or unsigned. […]

Read More →

.SELECT General

Object Oriented Style Does Record Exist Simple Get A Result Alternative with check for no result Get Each Row Returned Procedural Style Does Record Exist Simple Get A Result Get Each Row Returned Get Number Of Rows Returned Get Specific Columns Get each field as a variable named as the field Using OR Arguments Putting All […]

Read More →

.DELETE General

Object Oriented Style Procedural Style Delete old records by date Delete table Truncate is the fastest method to delete all data in a table as the table is dropped and re-creaed.

Read More →

.INSERT General

Object Oriented Style Get Auto ID Of New Record Procedural Style Get Auto ID Of New Record The mysqli_insert_id() function returns the ID generated by a query on a table with a column having the AUTO_INCREMENT attribute. If the last query wasn’t an INSERT or UPDATE statement or if the modified table does not have a […]

Read More →

Auto Index Row

Create as 'Int' and set to 'Auto Increment' Don't call the row Index as its a special MySQL word which you'll have to use in quotes if you do.

Read More →