I need a script to extract the database details from the wp-config.php file so I could keep the logon details in one location when I was coding something outside the WP framework. I came up with a class that does this, connects to mysql and selects the database. There are three connection options: PDO, mySQLi… Read more »
Posts Categorized: OOP
I was trying to supply binding params to a PDO query like this: However, this will not work. From the PHP manual – “Unlike PDOStatement::bindValue(), the variable is bound as a reference and will only be evaluated at the time that PDOStatement::execute() is called.” So, the correct way to do this would be: See also,… Read more »
Developing using OOP techniques takes longer in the intial code, but is easier to maintain. In the end it will save you time, produce less ‘buggy’ code, and help you write code that is re-usable.
Great article here http://www.ibm.com/developerworks/opensource/library/os-php-7oohabits