[PHP] PHP + PostgreSQL: pg_query not returning the expected result for this (edge) case:

2013-02-06 Thread Peter Ford
Here's a tricky one: Versions: I'm using PostgreSQL 9.0.7 and PHP 5.3.8. First, I have a table "bob" with two columns: "bobid" (integer) and "bobtext" (text). The "bobid" field defaults to a sequence called "bob_seq" which is just a simple counter (1,2,3 etc.) I can do an INSERT query into "b

[PHP] PHP/Postgresql problem

2004-01-13 Thread Ken Harris
I am trying to get PHP to work with an instance of postgresql on a server. There is already one, 'proprietary' postgresql running with its own user, own group and own (not default) port. The postgresql I am installing will be used for several database projects. following are my config/makes a

[PHP] PHP/Postgresql problem

2004-01-13 Thread Ken Harris
I am trying to get PHP to work with an instance of postgresql on a server. There is already one, 'proprietary' postgresql running with its own user, own group and own (not default) port. The postgresql I am installing will be used for several database projects. following are my config/makes a

[PHP] PHP POSTGRESQL AND WML

2003-07-21 Thread haydo hassan
Hi. I am trying to send two variables from login.wml to auth.php. But auth.php gets empty variables. here is the code for login.wml: http://www.wapforum.org/DTD/wml_1.1.xml";> Name: Password: Login

Re: [PHP] PHP & PostgreSQL

2003-01-01 Thread Vincent Oostindie
Michael Sims wrote: >>o Changing database structure is harder. With PG, I usually found it >> easier to dump, edit, then reload the database to make changes I did >> in MySQL with ALTER TABLE. > > True, changing schema is a major PITA with Postgres. My only real > complaint about it, in fact

Re: [PHP] PHP & PostgreSQL

2002-12-30 Thread Rick Widmer
At 07:59 AM 12/30/02 -0600, Michael Sims wrote: On Mon, 30 Dec 2002 04:11:02 -0700, you wrote: >, or the types SET and ENUM. I'm not sure what SET is, never used it, Color set( 'red', 'green', 'blue' ) can contain only the following values: NULL;'blue'; 'green'; 'green,blue'; '

Re: [PHP] PHP & PostgreSQL

2002-12-30 Thread Chris Boget
> Either you're confused or I'm confused :) It's me. This just hasn't been a good week for me. :p One time I'll get it right! > mysql_tablename() is used in conjunction with mysql_list_tables() to get the > names of the tables defined in the specified database. It cannot "get the > table name

Re: [PHP] PHP & PostgreSQL

2002-12-30 Thread Jason Wong
On Monday 30 December 2002 21:57, Chris Boget wrote: > > >o Pg doesn't have DATE_FORMAT() > > > > to_char() accomplishes the same thing, for example: > > select to_char(lastlogin, 'FMMM-DD- FMHH:MI AM') as lastloginf > > from users; > > Unless I missed something, that function doesn't work with

Re: [PHP] PHP & PostgreSQL

2002-12-30 Thread Chris Boget
> To convert TO a unix timestamp: > To convert FROM a unix timestamp: Excellent. Thank you very much for the info! > And there is the major benefit of using Postgres... Why do you think I decided to move to Postgres? :P > not to mention sub-selects, views, unions, etc. Indeed. And I'm goin

Re: [PHP] PHP & PostgreSQL

2002-12-30 Thread Jason Wong
On Monday 30 December 2002 21:33, Chris Boget wrote: > Due to writing this email *way* too early in the morning, I got > everything mixed up and didn't say what I meant. The below > is what I really meant. > > > Not sure what you're getting at here. Surely for any particular > > query, _you_ would

Re: [PHP] PHP & PostgreSQL

2002-12-30 Thread Michael Sims
On Mon, 30 Dec 2002 07:57:04 -0600, you wrote: >> >o Pg doesn't have DATE_FORMAT() >> to_char() accomplishes the same thing, for example: >> select to_char(lastlogin, 'FMMM-DD- FMHH:MI AM') as lastloginf >> from users; > >Unless I missed something, that function doesn't work with unix timestam

Re: [PHP] PHP & PostgreSQL

2002-12-30 Thread Chris Boget
> >o Pg doesn't have DATE_FORMAT() > to_char() accomplishes the same thing, for example: > select to_char(lastlogin, 'FMMM-DD- FMHH:MI AM') as lastloginf > from users; Unless I missed something, that function doesn't work with unix timestamps. Is there anythin internal to PG that allows you to

Re: [PHP] PHP & PostgreSQL

2002-12-30 Thread Michael Sims
On Mon, 30 Dec 2002 04:11:02 -0700, you wrote: >The things that bothered me the most: > >o Pg doesn't have DATE_FORMAT() to_char() accomplishes the same thing, for example: select to_char(lastlogin, 'FMMM-DD- FMHH:MI AM') as lastloginf from users; >, or the types SET and ENUM. I'm not sure

Re: [PHP] PHP & PostgreSQL

2002-12-30 Thread Chris Boget
Due to writing this email *way* too early in the morning, I got everything mixed up and didn't say what I meant. The below is what I really meant. > Not sure what you're getting at here. Surely for any particular > query, _you_ would know what table(s) is/are being used? That's not necessarily

RE: [PHP] PHP & PostgreSQL

2002-12-30 Thread Boget, Chris
> Sorry, you've lost me. In your OP you say you wanted the > "table name", but now you're talking about the "dbname"? > For dbname, you can use (oddly enough) pg_dbname(). Eeep, I'm ever so sorry. That's what I get for responding at 4:30a when trying to battle insomnia. Yes, I am looking for th

Re: [PHP] PHP & PostgreSQL

2002-12-30 Thread Jason Wong
On Monday 30 December 2002 19:11, Rick Widmer wrote: > At 06:20 PM 12/30/02 +0800, Jason Wong wrote: > >On Monday 30 December 2002 18:13, Boget, Chris wrote: > > > I'm switching from a MySQL environment to PGSQL and I'm > > > going through and trying to learn the differences between the > > > two.

RE: [PHP] PHP & PostgreSQL

2002-12-30 Thread Rick Widmer
At 04:41 AM 12/30/02 -0600, Boget, Chris wrote: You can do this in mysql. I just don't know why you can't do this in pgsql. The basic answer to why the interfaces to the databases differ is because the PHP interfaces reflects the C interface provided by the database authors. Most PHP extension

Re: [PHP] PHP & PostgreSQL

2002-12-30 Thread Rick Widmer
At 06:20 PM 12/30/02 +0800, Jason Wong wrote: On Monday 30 December 2002 18:13, Boget, Chris wrote: > I'm switching from a MySQL environment to PGSQL and I'm > going through and trying to learn the differences between the > two. The things that bothered me the most: o Pg doesn't have DATE_FOR

Re: [PHP] PHP & PostgreSQL

2002-12-30 Thread Jason Wong
On Monday 30 December 2002 18:41, Boget, Chris wrote: > > > * For PGSQL, you can get the database name, the field name > > > even the *host name* but you can't get the table name from a > > > particular query? > > > > Not sure what you're getting at here. Surely for any particular > > query, _you_

RE: [PHP] PHP & PostgreSQL

2002-12-30 Thread Boget, Chris
> pg_result_seek() should perform a similar function. In most cases > you wouldn't need to use that because if you're going to be using > the results more than once you could store them in an array. Sometimes yes, sometimes no. But a valid point nonetheless. > > * For PGSQL, you can get the da

Re: [PHP] PHP & PostgreSQL

2002-12-30 Thread Jason Wong
On Monday 30 December 2002 18:13, Boget, Chris wrote: > I'm switching from a MySQL environment to PGSQL and I'm > going through and trying to learn the differences between the > two. I've come across some issues that I can't seem to find the > answers to in the docs or on the web. I'm hoping some

[PHP] PHP & PostgreSQL

2002-12-30 Thread Boget, Chris
I'm switching from a MySQL environment to PGSQL and I'm going through and trying to learn the differences between the two. I've come across some issues that I can't seem to find the answers to in the docs or on the web. I'm hoping someone can help me out. * MySQL has a function to reset the resu

Re: [PHP] PHP & PostgreSQL

2001-03-04 Thread Andrew Halliday
we can put the field name in brackets after the table name. As before, the following will fail: DELETE FROM school WHERE id = 1; - AndrewH - Original Message - From: "Marcelo Pereira" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, March 05, 2001 1:00 AM Su

Re: [PHP] PHP & PostgreSQL

2001-03-04 Thread The Hermit Hacker
On Sun, 4 Mar 2001, Marcelo Pereira wrote: > Hi, All. > > I have to build a web site and I was > studying postgreSQL, but, whether I am > quite wrong or this database does not > support Foreign Key. > > Does anyone use postgreSQL and know > how handle Foreign Keys ??? Yes, it supports Foreign Ke

[PHP] PHP & PostgreSQL

2001-03-04 Thread Marcelo Pereira
Hi, All. I have to build a web site and I was studying postgreSQL, but, whether I am quite wrong or this database does not support Foreign Key. Does anyone use postgreSQL and know how handle Foreign Keys ??? Thanks, Marcelo Pereira Computer Programmer