Posted on Leave a comment

Simple & Light PHP MySql Db Class


( ! ) Notice: A non well formed numeric value encountered in /var/www/html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118
Call Stack
#TimeMemoryFunctionLocation
10.0001396136{main}( ).../index.php:0
20.0004396424require( '/var/www/html/wp-blog-header.php' ).../index.php:17
31.377112485360require_once( '/var/www/html/wp-includes/template-loader.php' ).../wp-blog-header.php:19
41.384412538336include( '/var/www/html/wp-content/themes/storefront/single.php' ).../template-loader.php:78
51.493713092064get_template_part( ).../single.php:19
61.493813092584locate_template( ).../general-template.php:168
71.493813092680load_template( ).../template.php:671
81.493913092952require( '/var/www/html/wp-content/themes/storefront/content-single.php' ).../template.php:724
91.494813093704do_action( ).../content-single.php:21
101.494813094080WP_Hook->do_action( ).../plugin.php:465
111.494813094080WP_Hook->apply_filters( ).../class-wp-hook.php:310
121.498013101592storefront_post_content( ).../class-wp-hook.php:286
131.498213102664the_content( ).../storefront-template-functions.php:414
141.498213103304apply_filters( ).../post-template.php:247
151.498213103704WP_Hook->apply_filters( ).../plugin.php:208
161.504613177752CrayonWP::the_content( ).../class-wp-hook.php:286
171.508513240704CrayonHighlighter->output( ).../crayon_wp.class.php:703
181.514513268832CrayonFormatter::print_code( ).../crayon_highlighter.class.php:189

( ! ) Notice: A non well formed numeric value encountered in /var/www/html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119
Call Stack
#TimeMemoryFunctionLocation
10.0001396136{main}( ).../index.php:0
20.0004396424require( '/var/www/html/wp-blog-header.php' ).../index.php:17
31.377112485360require_once( '/var/www/html/wp-includes/template-loader.php' ).../wp-blog-header.php:19
41.384412538336include( '/var/www/html/wp-content/themes/storefront/single.php' ).../template-loader.php:78
51.493713092064get_template_part( ).../single.php:19
61.493813092584locate_template( ).../general-template.php:168
71.493813092680load_template( ).../template.php:671
81.493913092952require( '/var/www/html/wp-content/themes/storefront/content-single.php' ).../template.php:724
91.494813093704do_action( ).../content-single.php:21
101.494813094080WP_Hook->do_action( ).../plugin.php:465
111.494813094080WP_Hook->apply_filters( ).../class-wp-hook.php:310
121.498013101592storefront_post_content( ).../class-wp-hook.php:286
131.498213102664the_content( ).../storefront-template-functions.php:414
141.498213103304apply_filters( ).../post-template.php:247
151.498213103704WP_Hook->apply_filters( ).../plugin.php:208
161.504613177752CrayonWP::the_content( ).../class-wp-hook.php:286
171.508513240704CrayonHighlighter->output( ).../crayon_wp.class.php:703
181.514513268832CrayonFormatter::print_code( ).../crayon_highlighter.class.php:189

In my world, a PHP db class in essence should be a black box that handles the concerns of direct interaction with the MySql database and provides an abstract but functional alone basis for my model classes. The Db class must handle connecting to the database, and have inheritable static methods for executing both statements and queries. Also it must be tested before it is put into production. This code is tested and ready for production.

I originally wrote this class in a side-project of mine, and I’ve been using it recently as a teaching tool.