How to Resolve MySQL Error Code: 1548 Cannot load from mysql.proc. The table is probably corrupted

MySQL will sometimes return the error message “Cannot load from mysql.proc. The table is probably corrupted”. This happens due to schema changes required for different MySQL server versions. The simple fix to this problem is to run the mysql_upgrade command from the command line.

Continue reading How to Resolve MySQL Error Code: 1548 Cannot load from mysql.proc. The table is probably corrupted


Convert SQL Formatted DateTime Into More Readable Format Using PHP’s strtotime

By using PHP to work with the very popular SQL column type DateTime, it is possible to format a timestamp in any configuration. PHP quickly and easily enables a simple, robust and handy function to represent DateTime in any format you see fit.

PHP’s time() uses Unix timestamps for its date functionality, but contains functions to convert any other timestamp into the exact date formatting (text or otherwise) you are looking to accomplish. This includes working with SQL’s popular DateTime format.

As mentioned PHP uses Unix Epoch time, or POSIX time, it is a system for describing points in time. It is the amount of seconds between January 1st 1970 00:00:00 (Unix Epoch) and the present time, to the closest second. It is widely used not only on Unix operating systems, but in many other computing systems including PHP and the Java programming language. PHP’s own time() uses Unix epoch time. This makes it necessary to convert DateTime into a format PHP is comfortable working with.

Continue reading Convert SQL Formatted DateTime Into More Readable Format Using PHP’s strtotime


Using PHP’s var_dump() to Display SQL Query Results

Using the power of PHP’s var_dump() displays structured information about one or more expressions that includes its type and value. By definition var_dump() is a debugging tool, which displays structured information about any PHP variable. Below is a handy bit of code using var_dump() to test and verify that a SQL query contains data and view the contents using PHP:


$sql = mysql_query("SELECT * FROM your_table WHERE key = 'value'");
$assoc = mysql_fetch_assoc($sql);

// Dump variable containing the result of the MySQL query
var_dump($assoc);

Continue reading Using PHP’s var_dump() to Display SQL Query Results