MySQL Affected Rows vs Rows Matched

PHP’s mysql_affected_rows() is used to get the number of rows that were “affected” by the last query executed using mysql_query(). Therefore, an UPDATE query that set the value of a …

Secure Password Encryption using BCrypt with PHP

Implementing login functionality in your application comes with the responsibility of securely storing your users’ passwords in your database. Storing the password as plain text is highly irresponsible since a …

Using PHP Variables in .htaccess

My solution to using PHP variables in the .htaccess file was to create a htaccess.php file which would write the .htaccess file whenever needed. htaccess.php

PHP Date Format vs MySQL Date Format

Today I had the pleasure of discovering (through an hour of annoying debugging) that PHP’s formatting of dates is not exactly identical to MySQL’s date formatting. I was using a …