pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Matthias Ritzkowski <matthiar@gmail.com>
To: pgsql-php@postgresql.org
Subject: Re: Looking for some assistance / guidance --
Date: Mon, 28 Jul 2014 21:03:47 -0400
Message-ID: <53D6F2F3.4050707@gmail.com> (raw)
In-Reply-To: <CALWasQ=LmiZsZdJ1sLUT4jWrULSOLNsGS298yLkafKbEppbEHQ@mail.gmail.com>
References: <CALWasQ=LmiZsZdJ1sLUT4jWrULSOLNsGS298yLkafKbEppbEHQ@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-php>

Is the array maybe zero-based?

Did you try 'select web.sendKeys$0, $1, $2, $3' ....

Regards
Matthias

On 7/28/14, 8:45 PM, Jeff Silberberg wrote:
> Good evening --
>
> I have a Wordpress / HTML form that includes <select size="5" multiple 
> name=Keys[]"....>
>
> The form calls a PHP CGI program and if I set it to phpinfo()  I see 
> that the array Keys is in the post data.  An I can do a $selectedKeys 
> = $_POST('Keys')  and walk through and echo out the array elements 
> without a problem.
>
> My issues start when I attempt to pass the array of Keys to my 
> PostgreSql function with a parameter list of (web_Keys_ integer[], 
> web_text_ text, web_user_ text) ................
>
> in my php I do a pg_connect, and then prepare a number of statements 
> all of which work but the last one.
>
>     it is $return_cde = pg_prepare($conn, "SendKeys", 'select 
> web.sendKeys$1, $2, $3)');.
>
>    and I try to execute this with
>
>       $userKey=$_POST['Keys'];
>       $userText=$_POST['msgText'] . " / " . $current_user->display_name;
>
>       $return = pg_execute($conn, "SendKeys", array($userKey, 
> $userText, $current_user->display_name));
>
>       Which returns and error --
>
>
>     function.pg-execute
>     <http://dispatch.dapage.net/cgi-bin/function.pg-execute;]: Query
>     failed: ERROR: array value must start with "{" or dimension
>     information in
>     */home/xxxxxxx/public_html/enterkey/cgi-bin/xxxxxxcgi.php* on line
>     *90*
>
>
>       echo "User Keys " . gettype($userKey)."<br>\n";   confirms this 
> is a Array ..    An I have tried casting  $1::int[]  in the prepare 
> with no luck..
>
>       I find a lot of hits on Google searches but no solutions..
>
>       Hoping someone here can assist me with this issue..
>
> =============
>
>

view thread (5+ messages)  latest in thread

Message-ID: <53D6F2F3.4050707@gmail.com>
Permalink:  ../53D6F2F3.4050707@gmail.com/
Also on:    postgresql.org/message-id/53D6F2F3.4050707@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: matthiar@gmail.com
  Subject: Re: Looking for some assistance / guidance --
  In-Reply-To: <53D6F2F3.4050707@gmail.com>
  References: <CALWasQ=LmiZsZdJ1sLUT4jWrULSOLNsGS298yLkafKbEppbEHQ@mail.gmail.com> <53D6F2F3.4050707@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox