Re: [PHP-DB] header

2002-09-05 Thread Devrim GUNDUZ


Hi Meltem,

On Thu, 5 Sep 2002, Meltem Demirkus wrote:

  hi,
 I am new on php  Just want to know I am using mysql and php on a page ..
 and after the page do what it should do , I want it to go to another
 page..so I though  about using header (Location:...)  but it is giving
 error message  iii..

Be sure that your code produces no output before header line.

HTH

-- 

Devrim GUNDUZ

[EMAIL PROTECTED] Tel  : (312) 295 9318
[EMAIL PROTECTED]  Faks : (312) 295 9494

Web : http://devrim.oper.metu.edu.tr
-



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] [PHP] pg_connect() unable to connect to PostgreSQLserver :could not connect to server

2002-07-22 Thread Devrim GUNDUZ


Hi,

On Mon, 22 Jul 2002, Vincent wrote:

 Warning: pg_connect() unable to connect to PostgreSQL
 server: could not connect to server: Connection
 refused Is the server running on host localhost and
 accepting TCP/IP connections on port 5432? in
 /usr/local/apache/htdocs/postgresql.php on line 8
  Unable to connect to database

Please avoid using host=localhost in pg_connect parameters.

As far as I guess, you have not activated the TCP-IP port in 
postgresql.conf, and if you use host=localhost parameter, pg_connect will 
try to connect to PostgreSQL via TCP-IP. If you do not use that parameter, 
then it will connect to the database via Unix domain sockets, which is 
really faster than TCP-IP sockets (and more secure).

HTH.

Best regards.

 -- 

Devrim GUNDUZ

[EMAIL PROTECTED]
[EMAIL PROTECTED]

Web : http://devrim.oper.metu.edu.tr
-






-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] PHP4 Not Seeing PostgreSQL 7.2

2002-07-22 Thread Devrim GUNDUZ


On Sun, 21 Jul 2002, Eric wrote:


 Our Apache web server runs under a unix account (of course).

 In the PostgreSQL world, you have to create a database user under the 
 same name like so:

 ./createuser webserver

 Once we did this -- everything worked.

 What puzzles me though is that PHPINFO() doesn't even show that pgsql is
 compiled in when apparently it was there all along.


Well, you are wrong... You do not need to use the same username of you web 
server...

I mean, if you do NOT add a username parameter in your connection 
definition, then will use the username that you are running on.

Let me explain like this:

- If you connect via PHP and write
pg_connect (dbname=mydb); -- PHP will think that you want to connect 
with the username that apache runs (maybe nobody, maybe another user)

- If you connect via psql and write
[devrim@oper devrim]$ psql mydb -- Then psql will assume that the 
username that it will use while connecting to PostgreSQL is devrim.

So, use postgres user for your connections... Or use another username and 
grant access to that user.

Best regards.

-- 

Devrim GUNDUZ

[EMAIL PROTECTED]
[EMAIL PROTECTED]

Web : http://devrim.oper.metu.edu.tr
-







-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] [PHP] pg_connect() unable to connect to PostgreSQLserver :could not connect to server

2002-07-22 Thread Devrim GUNDUZ



On Mon, 22 Jul 2002, Eric wrote:

 I agree, Unix domain sockets very much faster.
 
 You have to start POSTMASTER with the -i switch to get it to listen on the
 designated port (5432 by default I think).

If you'll use Unix domain sockets, then do not use -i parameter. 

:) 

Best regards.

-- 

Devrim GUNDUZ

[EMAIL PROTECTED]
[EMAIL PROTECTED]

Web : http://devrim.oper.metu.edu.tr
-



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] Last ID from database?

2002-06-26 Thread Devrim GUNDUZ


Hi Chris,
On Wed, 26 Jun 2002, Chris Payne wrote:

 Hi there everyone,
  
 How Can I grab just the LAST ID from a database in MySQL with PHP
 easily?

?
 If(last id == max id) 
 {
// then   use this query:
SELECT max(id) from my_table;
 }
 else if (last id == the last data in the table) {
 // then   use this query:
 SELECT id FROM my_table ORDER BY id DESC limit 1;
 }

:-)

Best regards.
-- 

Devrim GUNDUZ

[EMAIL PROTECTED]
[EMAIL PROTECTED]

Web : http://devrim.oper.metu.edu.tr
-





-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php