Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id C57AE63266B for ; Wed, 19 Aug 2009 18:15:49 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 69704-01 for ; Wed, 19 Aug 2009 21:15:38 +0000 (UTC) X-Greylist: delayed 00:31:19.220248 by SQLgrey-1.7.6 Received: from smtp-gw51.mailanyone.net (smtp-gw51.mailanyone.net [208.70.128.77]) by mail.postgresql.org (Postfix) with ESMTP id C1FC763248B for ; Wed, 19 Aug 2009 18:15:38 -0300 (ADT) Received: from mailanyone.net by smtp-gw51.mailanyone.net with esmtpa (MailAnyone extSMTP andy@networkmail.eu) id 1MdsV8-0001UK-Ie; Wed, 19 Aug 2009 16:15:33 -0500 Message-ID: <4A8C6B7D.7020806@networkmail.eu> Date: Wed, 19 Aug 2009 22:15:41 +0100 From: Andy Shellam User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: Eric Chamberlain CC: "pgsql-php@postgresql.org" Subject: Re: Stored procedures, PDO, and PHP issue References: <4A8C6432.2050500@networkmail.eu> <2AE0AB18-0F9D-4A32-92D3-4D86F176D432@zonarsystems.com> In-Reply-To: <2AE0AB18-0F9D-4A32-92D3-4D86F176D432@zonarsystems.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200908/14 X-Sequence-Number: 4055 Hi Eric, > > Unfortunately this does not work or I maybe doing it wrong. New code: > $stmt = $db->prepare("SELECT is_password_expired($1::integer, > $2::varchar); > $stmt->bindValue(1, settype($userId, "integer"), PDO::PARAM_INT); > $stmt->bindValue(2, $hashPass, PDO::PARAM_STR); > $stmt->execute(); settype() doesn't return anything so it needs to be used on it's own line. E.g.: $userId = "2"; // string settype($userId, 'integer'); // $userId is now an integer $stmt->bindValue(1, $userId, PDO::PARAM_INT); > > I get a blank screen. I've tried setting the error reporting level to: > > error_reporting(E_ALL); > > before calling the above code. Our servers are configured to display > errors, etc. The fact that it just goes blank tells me there is a > bigger issue going on. Does your server definitely have display_errors set to On as well as the error_reporting line, and it's not been overridden by your application? I've only ever known really serious errors (i.e. core dumps) to not display anything even when display_errors is set to on. What's logged in your Apache or IIS error log? Lastly have you tried "named" parameters? From the PHP manual: (actually the PostgreSQL syntax "$1::integer" I suggested may have caused PHP to crash as PDO uses a colon to introduce a named parameter.) |$stmt = $dbh->prepare("INSERT INTO REGISTRY (name, value) VALUES (:name, :value)"); $stmt->bindParam(':name', $name); $stmt->bindParam(':value', $value);| Andy