Lines Matching refs:PDO
2 MySQL PDO:query() vs. PDO::prepare() and MySQL error 2050
21 $db->setAttribute(PDO::MYSQL_ATTR_DIRECT_QUERY, 0);
22 if (0 != $db->getAttribute(PDO::MYSQL_ATTR_DIRECT_QUERY))
27 $db->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true);
29 var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
31 var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
35 $db->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, false);
37 var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
42 PDO::query() will prepare and execute a statement in one step.
43 After the execution of PDO::query(), MySQL expects you to fetch
45 PHP/PDO will send a CLOSE message as part of the PDO::query() call.
49 $stmt = PDO::query(<some query>)
57 $stmt = PDO::query(<some query>)
58 PDO::query(<some query>)
64 $stmt = PDO::query(<some query>)
67 zval representing the current value of $stmt. PDO gets a callback that
79 PDO to $stmt.
84 - as there is no explicit close() in PDO, try unset($stmt) before the new assignment
85 - fix PDO::query() [not the driver, fix PDO itself]
89 var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
93 var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
97 var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
101 var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
105 var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));