A Better Way to Use PHP's MySQLi

August 8 2010, 11:48pm

"PHP’s prepared statements (for database access) are fantastic. Not only do they help secure your database queries, but they’re also particularly more efficient for larger products. However, there are a couple issues that appear to make these methods less flexible than we’d hope. For one, we must utilize the bind_result method, and pass in a specific number of variables. However, what happens when this code is within a class, and we won’t immediately know how many variables to pass? Luckily, there’s a solution!"