I'm curious to know if it's possible to bind an array of values to a placeholder using PDO. The use case here is attempting to pass an array of values for use with an IN() condition. I'm not very good at explaining, so here's some psuedocode to demonstrate... I'd like to be able to do something like this:
Ccna final exam - java, php, javascript, ios, cshap all in one. This is a collaboratively edited question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
Tuesday, June 5, 2012
PHP PDO: Can I bind an array to an IN() condition?
Friday, May 25, 2012
mysqli or PDO - what are the pros and cons?
In our place we're split between using mysqli and PDO for stuff like prepared statements and transaction support. Some projects use one, some the other. There is little realistic likelihood of us ever moving to another RDBMS.
Tuesday, May 15, 2012
How to determine if PDO enabled in PHP
Is there a PHP command I can use to determine if PDO is enabled or disabled?
Wednesday, May 9, 2012
How do I know if a Prepared Statement is being Cached?
I have been reusing the same variable $stmt in my PHP script to write prepared statements:
Friday, May 4, 2012
Use of PDO in classes
I have a few classes that perform some MySQL queries and prepared statements. However, I am lost in how to incorporate my PDO object within those classes. For example, I want to do something like this:
Thursday, April 12, 2012
How do I create a PDO parameterized query with a LIKE statement in PHP?
Here's my attempt at it:
$query = $database->prepare('SELECT * FROM table WHERE column LIKE "?%"');
$query->execute(array('value'));
while ($results = $query->fetch())
{
echo $results['column'];
}
Tuesday, February 14, 2012
How to manipulate a rowset data from sql to php
I have asked a question about how to retrieve data from different tables in sql How to get data from 4 tables in 1 sql query?
Friday, February 10, 2012
Converting MySQL to PDO
I've been advised a couple of times on here to start changing my code to PDO and I've finally got round to doing it. My problem is that I'm having incredible difficulty with converting my existing login script. For the last few lines of the code below (after the line $result = $query->fetchAll(); ) I haven't been able to find any resources online that could help me re-write it:
Friday, January 13, 2012
PDO_OCI: could not find driver
Today my problem is connected with PDO, OCI8 and PDO_OCI. But from the beginning.