pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
HELP
16+ messages / 12 participants
[nested] [flat]

* HELP
@ 2001-02-19 07:23  Riju Francis <rijufrancis@yahoo.com>
  0 siblings, 0 replies; 16+ messages in thread

From: Riju Francis @ 2001-02-19 07:23 UTC (permalink / raw)
  To: pgsql-php

> Hi,
>
> I was browsing through the net for solutions to my
> problem of
> connecting to
> postgres through PHP.
>
> You had posted something regarding connections to
> postgres through php.
>
> I was wondering if you could help me with my
postgres
> connection
> problem
> using php.
>
> I wish to connect to Postgres through PHP4
> I have modified the extension_dir to point to the
> directory where the
> extension dlls are stored.
> extension_dir = "C:\php4\extensions"
>
> and even uncommented the line
> extension = php_pgsql.dll
>
> After making the above changes, i get an error
message
> when i run any
> page
> in php. The error appears in a messagebox like the
> alert() in
> javascript.
> The error reads :
> Title   : php.exe - Entry Point Not Found
> Message : The procedure entry point zend_error could
> not be located in
> the
> dynamic link library php4ts.dll
>
> Could you help me with this.
>
> Or just tell me the procedure you went through to
get
> the postgres
> connection using PHP.
>
> Waiting for your reply.
>
> Thanks.
>
> Regards,
> Riju Francis.

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/



^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* HELP
@ 2001-02-19 07:26  Riju Francis <rijufrancis@yahoo.com>
  0 siblings, 0 replies; 16+ messages in thread

From: Riju Francis @ 2001-02-19 07:26 UTC (permalink / raw)
  To: pgsql-php

Hi,

Could you please help me with my postgres
connection problem using php.

I wish to connect to Postgres through PHP4
I have modified the extension_dir to point to the
directory where the extension dlls are stored.
extension_dir = "C:\php4\extensions"

and even uncommented the line
extension = php_pgsql.dll

After making the above changes, i get an error message
when i run any page in php. 
The error appears in a messagebox like the
alert() in javascript.
The error reads :
Title   : php.exe - Entry Point Not Found
Message : The procedure entry point zend_error could
not be located in the dynamic link library php4ts.dll

Could you help me with this or could you tell me some
other way to connect to Postgres in PHP.

My Apache Web Server and PHP is on WinNT
My PostgreSQL database is on Linux on a different
server.

Waiting for your reply.

Thanks.

Regards,
Riju Francis.

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/



^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* help
@ 2002-02-18 08:44  arun kv <arun@library.iisc.ernet.in>
  0 siblings, 1 reply; 16+ messages in thread

From: arun kv @ 2002-02-18 08:44 UTC (permalink / raw)
  To: pgsql-php

hello sir,
    accidently i deleted template1 directory fro /var/local/base wihich
contains database files. what can i do now. if i reinstall will my other
databases work without any problem. now when i try to create new database
with CREATEDB command, it gives error that template1 dir not found. what
best can i do now to get my databases working.
   thanking you
    Arun




^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: help
@ 2002-02-25 04:26  Josh Berkus <josh@agliodbs.com>
  parent: arun kv <arun@library.iisc.ernet.in>
  0 siblings, 0 replies; 16+ messages in thread

From: Josh Berkus @ 2002-02-25 04:26 UTC (permalink / raw)
  To: arun kv <arun@library.iisc.ernet.in>; pgsql-php

Arun,

>     accidently i deleted template1 directory fro /var/local/base
>  wihich
> contains database files. what can i do now. if i reinstall will my
>  other
> databases work without any problem. now when i try to create new
>  database
> with CREATEDB command, it gives error that template1 dir not found.
>  what
> best can i do now to get my databases working.
>    thanking you

Since Postmaster seems to be running, follow these steps:

1. using pg_dump, back up all databases.
2. write down all of your database users and their passwords.
3. Back up your databases using pg_dump again, to different files.
  Make sure everything is there ... spot-check some of the files.
   Count the files and count the databases.   Be very, very sure you
 have everything.  (WARNING! If you are using a BETA version of
 postgresql, or version 7.1.0 or 7.0.1, pg_dump may not function
 perfectly and you should stop here!)
4. Delete everything in the pgsql/data/ directory.
5. Run initdb.
6. Re-create the users and CREATEDB databases that we just deleted.
7. Restore each database from the pg_dump files, as the appropriate
 user.


______AGLIO DATABASE SOLUTIONS___________________________
                                       Josh Berkus
  Complete information technology      josh@agliodbs.com
   and data management solutions       (415) 565-7293
  for law firms, small businesses        fax 621-2533
    and non-profit organizations.      San Francisco



^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* help !!!
@ 2002-06-17 10:17  Alxander A. Kapralov <sasha@province.ru>
  0 siblings, 2 replies; 16+ messages in thread

From: Alxander A. Kapralov @ 2002-06-17 10:17 UTC (permalink / raw)
  To: pgsql-php

 function PaperList () {
        global $db;
        $str = "select gazeta.id as i,gorod.id as ig,trim(gazeta.name,' 
') as gaz_n, trim(gorod.name,' ') as gor_n from gazeta,gorod where 
gazeta.id_gorod=gorod.id order by gazeta.name asc;";
        $result = pg_Exec( $db, $str );
        if ($result = pg_Exec( $db, $str ) != false && ($num = 
pg_numrows($result)) ) {
            for ($i = 0; $i < $num; $i++) {
                $r = pg_fetch_object($result, $i);
                    ^^^^^   -- here get error message
                echo "<OPTION VALUE=$r->i> $r->gor_n / $r->gaze_n\n";
            };
        };
    };

Supplied argument is not a valid PostgreSQL result resource in ib.inc
Can any one explain that  !!!!





^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: help !!!
@ 2002-06-17 17:10  Keary Suska <hierophant@pcisys.net>
  parent: Alxander A. Kapralov <sasha@province.ru>
  1 sibling, 1 reply; 16+ messages in thread

From: Keary Suska @ 2002-06-17 17:10 UTC (permalink / raw)
  To: pgsql-php

on 6/17/02 4:17 AM, sasha@province.ru purportedly said:

> function PaperList () {
> global $db;
> $str = "select gazeta.id as i,gorod.id as ig,trim(gazeta.name,'
> ') as gaz_n, trim(gorod.name,' ') as gor_n from gazeta,gorod where
> gazeta.id_gorod=gorod.id order by gazeta.name asc;";
> $result = pg_Exec( $db, $str );
> if ($result = pg_Exec( $db, $str ) != false && ($num =
> pg_numrows($result)) ) {
> for ($i = 0; $i < $num; $i++) {
> $r = pg_fetch_object($result, $i);
> ^^^^^   -- here get error message
> echo "<OPTION VALUE=$r->i> $r->gor_n / $r->gaze_n\n";
> };
> };
> };
> 
> Supplied argument is not a valid PostgreSQL result resource in ib.inc
> Can any one explain that  !!!!

Are you sure the offending line is the one you think it is? Line numbers
reported can be misleading since PHP looks at lines differently than most
text editors. There could possibly be an obscure precedence issue with your
if() statement. I recommend getting rid of the first pg_exec call (you are
actually calling the query twice--the pg_exec in the if() statement executes
the query a second time), and changing the if() statement:

if ( $result = pg_exec( $db, $str ) and $num = pg_numrows($result) ) {
  for ($i = 0; $i < $num; $i++) {
    $r = pg_fetch_object($result, $i);
    echo "<OPTION VALUE=$r->i> $r->gor_n / $r->gaze_n\n";
  };
};

Note the changed if() statement. This should clarify the precedence.

Keary Suska
Esoteritech, Inc.
"Leveraging Open Source for a better Internet"




^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: help !!!
@ 2002-06-17 18:18  Cornelia Boenigk <poppcorn@cornelia-boenigk.de>
  parent: Alxander A. Kapralov <sasha@province.ru>
  1 sibling, 0 replies; 16+ messages in thread

From: Cornelia Boenigk @ 2002-06-17 18:18 UTC (permalink / raw)
  To: Alxander A. Kapralov <sasha@province.ru>; pgsql-php

Hi Alxander

> $r = pg_fetch_object($result, $i);
This syntax is valid since PHP 4.2.0. Are you sure that you use no
older PHP-Version?


>         $result = pg_Exec( $db, $str );
>         if ($result = pg_Exec( $db, $str ) != false && ($num =
> pg_numrows($result)) ) {

In the second line of the code-snippet you execute pg_exec a second
time. Write instead:

        $result = pg_Exec( $db, $str );
        if ($result  && ($num = pg_numrows($result))) {

Regards
Conni




^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: help !!!
@ 2002-06-18 07:58  Alxander A. Kapralov <sasha@province.ru>
  parent: Keary Suska <hierophant@pcisys.net>
  0 siblings, 0 replies; 16+ messages in thread

From: Alxander A. Kapralov @ 2002-06-18 07:58 UTC (permalink / raw)
  To: Keary Suska <hierophant@pcisys.net>; +Cc: pgsql-php



Keary Suska wrote:

>Are you sure the offending line is the one you think it is? Line numbers
>reported can be misleading since PHP looks at lines differently than most
>text editors. There could possibly be an obscure precedence issue with your
>if() statement. I recommend getting rid of the first pg_exec call (you are
>actually calling the query twice--the pg_exec in the if() statement executes
>the query a second time), and changing the if() statement:
>
>if ( $result = pg_exec( $db, $str ) and $num = pg_numrows($result) ) {
>  for ($i = 0; $i < $num; $i++) {
>    $r = pg_fetch_object($result, $i);
>    echo "<OPTION VALUE=$r->i> $r->gor_n / $r->gaze_n\n";
>  };
>};
>
>Note the changed if() statement. This should clarify the precedence.
>
>Keary Suska
>Esoteritech, Inc.
>"Leveraging Open Source for a better Internet"
>
I am so sorry, but this exasperating mistake with repeated call pg_exec 
...  

Thank you for help. 






^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* help
@ 2002-11-15 06:23  arun kv <arun@library.iisc.ernet.in>
  0 siblings, 0 replies; 16+ messages in thread

From: arun kv @ 2002-11-15 06:23 UTC (permalink / raw)
  To: pgsql-php; +Cc: php-xml@yahoogroups.com

hello,
       maybe wrong question to wrong site.  i have to use soap in php to
carry out a task.what all i need to do it.what all i shud download and
install and how to start.
     pls somebody help
             thanks
                  Arun




^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re:  help
@ 2002-11-15 07:49  debianabbestia@inwind.it <debianabbestia@inwind.it>
  0 siblings, 0 replies; 16+ messages in thread

From: debianabbestia@inwind.it @ 2002-11-15 07:49 UTC (permalink / raw)
  To: pgsql-php

> hello,
>        maybe wrong question to wrong site.  i have to use soap in php 
to
> carry out a task.what all i need to do it.what all i shud download and
> install and how to start.

If you need any info about how to interface postgresql to soap and php, 
that's the right place, but you should be more explicit in order to let 
us know what is your problem, don't you?

steX 

Unix IS user friendly... It's just selective about who its friends are.







^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Help...
@ 2002-12-16 22:26  Francisco Mosse - (Zivals) <fmosse@zivals.com>
  0 siblings, 1 reply; 16+ messages in thread

From: Francisco Mosse - (Zivals) @ 2002-12-16 22:26 UTC (permalink / raw)
  To: pgsql-php

Hi!

What is wrong? My server has PHP and Postgre
I can´t understand hoy do I get this error... look
I start with a value ($quebuscototal) and I should get an array like this ("'abc', 'def', 'ghi', 'jkl') ?
but with this code, what I receive is an array where the first element is 'abc', 'def', 'ghi', 'jkl'
instead of being 'abc' (and the second one, 'def', the third one 'ghi', etc.)

$quebuscototal = "abc def ghi jkl";
$quebuscototal = str_replace(' ',' \', \'',$quebuscototal);
$quebuscototal = "'$quebuscototal'";
$quebuscofinal = array($quebuscototal);
$quees = "$quebuscofinal[1] ";

What is wrong with my code? Thanks!!
Francisco
------------------------- 
Francisco Mosse 
Coordinador de www.TangoStore.com
Zivals S.A. - Tangostore.com 
Av. Callao 395 
C1022AAD Buenos Aires 
Argentina 
Tel 54 11 4371 7500 
Fax 54 11 4371 7437 

^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: Help...
@ 2002-12-16 23:02  scott.marlowe <scott.marlowe@ihs.com>
  parent: Francisco Mosse - (Zivals) <fmosse@zivals.com>
  0 siblings, 0 replies; 16+ messages in thread

From: scott.marlowe @ 2002-12-16 23:02 UTC (permalink / raw)
  To: Francisco Mosse - (Zivals) <fmosse@zivals.com>; +Cc: pgsql-php

On Mon, 16 Dec 2002, Francisco Mosse - (Zivals) wrote:

> Hi!
> 
> What is wrong? My server has PHP and Postgre
> I can´t understand hoy do I get this error... look
> I start with a value ($quebuscototal) and I should get an array like 
> this ("'abc', 'def', 'ghi', 'jkl') ?
> but with this code, what I receive is an array where the first element 
> is 'abc', 'def', 'ghi', 'jkl' instead of being 'abc' (and the second 
> one, 'def', the third one 'ghi', etc.)
> 
> $quebuscototal = "abc def ghi jkl";
> $quebuscototal = str_replace(' ',' \', \'',$quebuscototal);
> $quebuscototal = "'$quebuscototal'";
> $quebuscofinal = array($quebuscototal);
> $quees = "$quebuscofinal[1] ";

The array() construct is not a function, so it's generally used 
only to create arrays without variables.  I'm not sure if it can handle 
vars inside it.  There are maybe some tricks to get around this, but 
implode/explode are better for mucking with arrays anyway.

I'll try to give a little help.

$quebuscototal = "abc def ghi jkl";
$quees = explode(" ",$quebuscototal);

should result in an array like this:

$quees[0]="abc";
$quees[1]="def";
$quees[2]="ghi";
$quees[3]="jkl";

There are lots of fun ways to manipulate arrays in PHP, by the way.  Look 
at explode, implode, array_pop, array_push and some of the others listed 
in the docs.




^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* help ?
@ 2003-05-30 05:00  utomo restu <utomo@linuxmail.org>
  0 siblings, 1 reply; 16+ messages in thread

From: utomo restu @ 2003-05-30 05:00 UTC (permalink / raw)
  To: pgsql-php

Dear All

I'am a new user in postgresql, i want to ask about :

1. The one who is intended with STORED PROCEDURE, 
   how its implement and what its surplus. 
   Version POSTGRESQL that how much possess STRORED PROCEDURE. 

2. In when I make the function as follows:
   
   CREATE FUNCTION forward(CHAR(10))
   RETURNS CHAR(10), CHAR(30)
   AS 'select no_id, name FROM address where no_id=$1;'
   Language 'sql';
   
   To step forward orders the error ... 
   Which wants I asked, how make a function that can step forward
RETURNS More than a column 
   (I want to show 2 columns i.e. no_id and Name) ?

best regards
-- 
______________________________________________
http://www.linuxmail.org/
Now with e-mail forwarding for only US$5.95/yr

Powered by Outblaze



^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: [PHP] help ?
@ 2003-05-30 14:47  scott.marlowe <scott.marlowe@ihs.com>
  parent: utomo restu <utomo@linuxmail.org>
  0 siblings, 0 replies; 16+ messages in thread

From: scott.marlowe @ 2003-05-30 14:47 UTC (permalink / raw)
  To: utomo restu <utomo@linuxmail.org>; +Cc: pgsql-php; pgsql-general@postgresql.org


The PHP list is probably sub-optimal, so I'm cross posting this to 
general.  Whoever gets it next there, please remove the PHP cc then.

On Fri, 30 May 2003, utomo restu wrote:

> Dear All
> 
> I'am a new user in postgresql, i want to ask about :
> 
> 1. The one who is intended with STORED PROCEDURE, 
>    how its implement and what its surplus. 
>    Version POSTGRESQL that how much possess STRORED PROCEDURE. 

Every version I've ever used.  If you are running anything older than 
7.2.4 you should upgrade.

7.3.3 is the latest stable release, and it is quite stable and very fast.

> 2. In when I make the function as follows:
>    
>    CREATE FUNCTION forward(CHAR(10))
>    RETURNS CHAR(10), CHAR(30)
>    AS 'select no_id, name FROM address where no_id=$1;'
>    Language 'sql';
>    
>    To step forward orders the error ... 
>    Which wants I asked, how make a function that can step forward
> RETURNS More than a column 
>    (I want to show 2 columns i.e. no_id and Name) ?

You're going to need 7.3.x to do this, so you may as well upgrade to it 
now.  Record sets can be returned as of version 7.3.

For more information on record sets in stored procedures, see the 
programmer's guide:

http://www.postgresql.org/docs/view.php?version=7.3&idoc=0&file=programmer.html

Sepcifically the section on returning rows in plpgsql:

http://www.postgresql.org/docs/view.php?version=7.3&idoc=0&file=plpgsql-control-structures.h...

Happy hacking!




^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: help
@ 2003-07-03 11:22  Bruno Wolff III <bruno@wolff.to>
  1 sibling, 0 replies; 16+ messages in thread

From: Bruno Wolff III @ 2003-07-03 11:22 UTC (permalink / raw)
  To: yanping huang <yanping@altimate.ca>; +Cc: pgsql-php

On Wed, Jul 02, 2003 at 16:51:11 -0400,
  yanping huang <yanping@altimate.ca> wrote:
> Hi,
> I am learning postgreSQL. Why I can't get a correct result using LPAD?

You are getting a correct result. If you review the documentation on LPAD
you will see that the length is the total length of the resulting string,
not the number of times to repeat the fill string.

> 
> select LPAD('Hello',3);   not -> '   Hello'
>  lpad
> ------
>  Hel
> 
> select LPAD('ello',3,'H'); not -> 'HHHello'
>  lpad
> ------
>  ell
> 
> select LPAD('hen', 1, '^');
>  lpad
> ------
>  h
> 
> 
> How can I put a '^' befor a variable of VARCHAR type in a function?
> 
> Yanping
> -- 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
> 
>                http://archives.postgresql.org



^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: help
@ 2003-07-03 18:51  Andrew J. Kopciuch <akopciuch@bddf.ca>
  1 sibling, 0 replies; 16+ messages in thread

From: Andrew J. Kopciuch @ 2003-07-03 18:51 UTC (permalink / raw)
  To: yanping huang <yanping@altimate.ca>; pgsql-php

> How can I put a '^' befor a variable of VARCHAR type in a function?
>

Is this what you are looking for ... the concatentation operator?

select '^' || 'sometext'::varchar;



If you are asking about doing that in the function call :

select myfunction( '^' || var);



Andy



^ permalink  raw  reply  [nested|flat] 16+ messages in thread


end of thread, other threads:[~2003-07-03 18:51 UTC | newest]

Thread overview: 16+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-02-19 07:23 HELP Riju Francis <rijufrancis@yahoo.com>
2001-02-19 07:26 HELP Riju Francis <rijufrancis@yahoo.com>
2002-02-18 08:44 help arun kv <arun@library.iisc.ernet.in>
2002-02-25 04:26 ` Re: help Josh Berkus <josh@agliodbs.com>
2002-06-17 10:17 help !!! Alxander A. Kapralov <sasha@province.ru>
2002-06-17 17:10 ` Re: help !!! Keary Suska <hierophant@pcisys.net>
2002-06-18 07:58   ` Re: help !!! Alxander A. Kapralov <sasha@province.ru>
2002-06-17 18:18 ` Re: help !!! Cornelia Boenigk <poppcorn@cornelia-boenigk.de>
2002-11-15 06:23 help arun kv <arun@library.iisc.ernet.in>
2002-11-15 07:49 Re:  help debianabbestia@inwind.it <debianabbestia@inwind.it>
2002-12-16 22:26 Help... Francisco Mosse - (Zivals) <fmosse@zivals.com>
2002-12-16 23:02 ` Re: Help... scott.marlowe <scott.marlowe@ihs.com>
2003-05-30 05:00 help ? utomo restu <utomo@linuxmail.org>
2003-05-30 14:47 ` Re: [PHP] help ? scott.marlowe <scott.marlowe@ihs.com>
2003-07-03 11:22 ` Re: help Bruno Wolff III <bruno@wolff.to>
2003-07-03 18:51 ` Re: help Andrew J. Kopciuch <akopciuch@bddf.ca>

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