From: shadda at gmail dot com
Operating system: Debian 3.1
PHP version: 5.1.2
PHP Bug Type: PDO related
Bug description: Prepared statements killing script
Description:
------------
Using prepared statements causes my script to die, in two ways depending
on how I use them. If I use bindParam() the script dies silently (no
error, no exception thrown, even with PDO::ATTR_ERRMODE set to
ERRMODE_EXCEPTION) and I am unable to output anything (above or below).
When I pass the parameter through PDOStatement::execute(), I receive the
following error:
SQLSTATE[42P18]: Indeterminate datatype: 7 ERROR: could not determine data
type of parameter $1
Reproduce code:
---------------
<?php
//First Example
$query = $db->prepare("select font_name, path from fonts_list where id =
?");
$query->execute( array($_GET['foo']) );
//Produces error (see above)
//Second example
$query = $db->prepare("Select font_name, path from fonts_list where id =
:id");
$query->bindParam(':id', $id);
$id = $_GET['foo'];
$query->execute();
//Kills the script. No Error. Nothing error log.
--
Edit bug report at http://bugs.php.net/?id=36652&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=36652&r=trysnapshot44
Try a CVS snapshot (PHP 5.1):
http://bugs.php.net/fix.php?id=36652&r=trysnapshot51
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=36652&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=36652&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=36652&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=36652&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=36652&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=36652&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=36652&r=support
Expected behavior: http://bugs.php.net/fix.php?id=36652&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=36652&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=36652&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=36652&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=36652&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=36652&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=36652&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=36652&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=36652&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=36652&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=36652&r=mysqlcfg