ID:               38389
 Updated by:       [EMAIL PROTECTED]
 Reported By:      baldurien at bbnwn dot eu
-Status:           Open
+Status:           Closed
 Bug Type:         Documentation problem
 Operating System: Irrelevant
 PHP Version:      Irrelevant
 New Comment:

This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation
better.

"Defaults to PHP native type."


Previous Comments:
------------------------------------------------------------------------

[2006-08-08 21:59:20] baldurien at bbnwn dot eu

Description:
------------
I was wondering what is the default type of parameter when none is set?


Reproduce code:
---------------
If I run that code :

$dbh = new PDO(
  'mysql:host=localhost;dbname=xxx', 'xxx', 'xxx');
$stmt = $dbh->prepare('SELECT ? FROM DUAL WHERE 1 = ?');

var_dump($stmt->execute(array('aa\'aa', 'aaa')));

This dump true, meaning that 'aaa' was casted to a string and that the
actual query looks like this in mySQL :

SELECT 'aa''aa' FROM DUAL WHERE 1 = 'aaa'

Expected result:
----------------
The documentation should indicate that when no type is provided (while
calling bindParam(), bindValue(), or execute()), PDO::PARAM_STRING is
used. 

Actual result:
--------------
Neither bindParam(), bindValue() or execute() speak of a default type,
nor the main page of PDO (http://fr.php.net/manual/en/ref.pdo.php)
describe it. Thus, we could expect anything from the driver (like
casting variable into integer instead of string).


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=38389&edit=1

Reply via email to