Error Pages

#———- ERROR PAGE REDIRECTS ———- ErrorDocument 403 http://www.mydomain.com/index.php ErrorDocument 404 http://www.mydomain.com/index.php

Read More

Comments

Use the hash character: # Main Menu Links or use at each end if preferred # Main Menu Links #  

Read More

.Include General

include ('classes/config.php'); include_once ('classes/config.php'); require ('classes/config.php'); require_once ('classes/config.php'); Included Files Corrupting Things Whitespace before or after the php start and end markers White space or any characters before or after the <?php and ?> will be output in the same way as echo(as html) in an included file. This can be a problem, for instance having a line […]

Read More

Rewrite rules

Good Resources For Example Rules https://gist.github.com/ScottPhillips/1721489 Before the rules Options +FollowSymLinks RewriteEngine On RewriteBase / No Parameters Example RewriteRule ^groups$ groups.php [L] 1 Parameter Example RewriteRule ^flips/([^/]*)$ flips.php?fid=$1 [L] Converts this URL format: http://www.mydomain.com/flips/996803385327 To this actual php page http://www.mydomain.com/flips.php?fid=996803385327   2 Parameter Example RewriteRule ^flips/([^/]*)/([^/]*)$ flips.php?fid=$1&valueb=$2 [L] Converts this URL format: http://www.mydomain.com/flips/996803385327/hello To this […]

Read More

Array Of SQL Results

Creating An Array Of All Results $all_results = array(); //Empty array to hold returned rows while ($row = @mysql_fetch_array($search_query)) { $all_results[] = $row; }      

Read More

DateTime general

ORDER BY Date Order ASC = oldest first DESC = most recent first Note it’s “MINUTE”, “HOUR”, etc not “MINUTES” or “HOURS” etc Convert DateTime to Date Specifying Date and DateTime from a string It is recommended to use CAST() Last Day Of Month (This produces a DATE result, not DATETIME) Get SQL Server’s Current […]

Read More