Re: Looking for some assistance / guidance --

Matthias Ritzkowski <[email protected]> Mon, 28 Jul 2014 21:03:47 -0400
Newsgroups gmane.comp.db.postgresql.php
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--------------000405000702090304090207
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

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..
>
> =============
>
>


--------------000405000702090304090207
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Is the array maybe zero-based?<br>
    <br>
    Did you try 'select web.sendKeys$0, $1, $2, $3' ....<br>
    <br>
    Regards<br>
    Matthias<br>
    <br>
    <div class="moz-cite-prefix">On 7/28/14, 8:45 PM, Jeff Silberberg
      wrote:<br>
    </div>
    <blockquote
cite="mid:CALWasQ=LmiZsZdJ1sLUT4jWrULSOLNsGS298yLkafKbEppbEHQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>
          <div>
            <div>
              <div>
                <div>
                  <div>Good evening -- <br>
                  </div>
                  <div><br>
                  </div>
                  I have a Wordpress / HTML form that includes
                  &lt;select size="5" multiple name=Keys[]"....&gt;<br>
                  <br>
                </div>
                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.  <br>
                <br>
              </div>
              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)
              ................<br>
              <br>
            </div>
            in my php I do a pg_connect, and then prepare a number of
            statements all of which work but the last one.  <br>
            <br>
          </div>
              it is $return_cde = pg_prepare($conn, "SendKeys", 'select
          web.sendKeys$1, $2, $3)');.  <br>
          <br>
        </div>
           and I try to execute this with <br>
        <br>
              $userKey=$_POST['Keys'];<br>
              $userText=$_POST['msgText'] . " / " .
        $current_user-&gt;display_name;<br>
        <br>
              $return = pg_execute($conn, "SendKeys", array($userKey,
        $userText, $current_user-&gt;display_name));<br clear="all">
        <div>
          <div>
            <div>
              <div><br>
              </div>
              <div>      Which returns and error -- <br>
                <h2 style="margin-left:40px">
                  <font><span style="font-family:courier new,monospace"><a
                        moz-do-not-send="true"
                        href="http://dispatch.dapage.net/cgi-bin/function.pg-execute">function.pg-execute</a>]:
                      Query failed: ERROR: array value must start with
                      "{" or dimension information in <b>/home/xxxxxxx/public_html/enterkey/cgi-bin/xxxxxxcgi.php</b>
                      on line <b>90</b></span></font></h2>
              </div>
              <div><br>
                      echo "User Keys " .
                gettype($userKey)."&lt;br&gt;\n";   confirms this is a
                Array ..    An I have tried casting  $1::int[]  in the
                prepare with no luck.. <br>
                <br>
              </div>
              <div>      I find a lot of hits on Google searches but no
                solutions.. <br>
                <br>
              </div>
              <div>      Hoping someone here can assist me with this
                issue.. <br>
                <br>
                =============<br>
              </div>
              <div><br>
                <div>
                  <div><br>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
  </body>
</html>

--------------000405000702090304090207--