[PHP-DB] How to stop the server timing out

2006-10-03 Thread David Skyers



Hi,I have written a php page and every time I run it, it 
causes the server to times-out. Is there anything I can do, to get the page to 
run completely or speed up how the page works. Please note I do not have any 
control over the server.The page does a select from a table and inserts 
the data into another table. However it times-out half way through 
inserting.The code is 
attached.Thanks,DavidDavid 
SkyersSupport AnalystManagement Systems, EISD, UCLExtension: 
41849Tel: 020 7679 1849Email: 
[EMAIL PROTECTED] 

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

[PHP-DB] Re: Unicode error with PostgreSQL

2006-10-03 Thread Nisse Engström
On Tue, 26 Sep 2006 12:05:56 -0600, Tony Grimes wrote:

 I'm getting the following error when PHP tries to insert a Unicode character
 (the problem word is resume with the accents) into a PostgreSQL database:
 
 pg_exec(): Query failed: ERROR:  Invalid UNICODE character sequence found
 (0xe97375)
 
 I can't figure out why I'm getting the error. The HTML form is utf-8 and the
 database is UNICODE, but I'm still getting the error. Is there some problem
 with the PHP library? Is there a PHP setting that controls character
 encoding within scripts? Any help would be appreciated.

   0xe97375 is ésu[1] in a lot of code pages such
as ISO-8859-1, and Windows cp1252. It is NOT a valid
UTF-8 sequence. I would guess that the form is sent
using one of those code pages and not UTF-8.


  --nfe

[1]: e-acute, s, u

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



[PHP-DB] Test

2006-10-03 Thread brian . kejser
Hi

Sorry for sending this test message but I haven't received a response from
the list daemon.

Thanks

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



[PHP-DB] mysql_error function

2006-10-03 Thread Honza Spurny
Hello, let me ask you something. I have a problem with mysql_error()
function after using mysql_connect(). Please look at thiese two examples:

Example 1

$link = mysql_connect($host, $user, $pswd) or die(Could not connect to
$host because:  . mysql_error());

/Example 1


Example 2

$link1 = mysql_connect($host1, $user, $pswd) or die(Could not connect to
$host because:  . mysql_error());
mysql_select_db($db, $link1);
// ... and here the code is going
// to query the selected DB

// Then I need to connect to another DB

$link2 = mysql_connect($host2, $user, $pswd) or die(Could not connect to
$host because:  . mysql_error());
// ... and here the code is going to work
// with another connection to another database

/Example 2


QUESTION and PROBLEM:

The first example work excelent, so when for example bad password is given,
the output is: Could not connect do _HOST_ because: Access denied for user
'_USER_'@'%'
(or something like it)

Lets have a look on the second example:
Lets say, that first connection works perfectly, so all quiries are well
done. But lets say, that second connection has wrong user/password given.
Then the error output is:
Could not connect to _HOST2_ because:

The error message for second connection request is not given back to the
PHP. Or as I suppose, mysql_error takes last error message from last used
ESTABLISHED connection (it means from $link1) and since in this connection
was everything ok, it puts empty string as a result of mysql_error function.
What can I do to get really last error message from mysql server? Last error
message is dedicated to last mysql_connection function, but since $link2 is
not established it is not given as a result of mysql_error function.

Can anybody help me, how to get really last error message that is
dedicated to last connection request?

Thanks a lot for any advice.
Honza Spurny

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



Re: [PHP-DB] How to stop the server timing out

2006-10-03 Thread Niel Archer
Hi,
 when you say the 'server' times out, do you mean the script reaches
it's execution limit (usually around 60 seconds).  If that is the case
and you have no control over the PHP environment, then there is little
you can do to help.

The only thing you can do in this situation is to improve the efficiency
of your SQL statement (or the db's structure) so it can execute and
return faster. But if you're processing a lot of data that may not be
enough

Niel

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



Re: [PHP-DB] mysql_error function

2006-10-03 Thread Niel Archer
Hi

 The error message for second connection request is not given back to the
 PHP. Or as I suppose, mysql_error takes last error message from last used
 ESTABLISHED connection (it means from $link1) and since in this connection
 was everything ok, it puts empty string as a result of mysql_error function.

This is incorrect.  mysql_error() retreives the error message from the
last mysql function (excluding itself or mysql_errno) executed, not the
last connection.


Niel

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



[PHP-DB] PHP-MySQL CMS Generator

2006-10-03 Thread Ted Weatherly
Does anyone know of a program that can generate a good Content Management
System?  For example, it would ask which fields to add to a database table,
the types of the fields, etc and create the database in MySQL and php's to
manage the data.  I did find a few such programs already (AppGini,
PHPRunner) but they don't allow custom templates.I'd like to control how the
pages look.

 

Thanks.

 

-t



[PHP-DB] Php 5 and Mysql on Windows

2006-10-03 Thread brian . kejser
Hi

I setup Php as follows:

1. Download the php zip file (not the installer)
2. Unzip the files to c:\Php
3. Add c:\php to the path
4. Copy php.ini-dist to php.ini
5. Add and enable the web extension php5isapi.dll
6. Add the .php extension mapping to php5isapi.dll at the the web sites
folder
7. Grant everyone read access to c:\php
8. Enable the mysql extension in php.ini
9. Set the extension_dir in php.ini to ./ext
10. Reboot

I setup Mysql as follows:

1. Download the 5.x installer
2. Run the installer
3. Run the configuration tool ater the installer

When I run the following script, the error Fatal error: Call to
undefined function mysql_connect() in Test.php on line 3  is returned.

?php

$conn = mysql_connect('localhost', 'root', 'password')

?

Any help would be appreciated.

Thanks

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



re: [PHP-DB] Php 5 and Mysql on Windows

2006-10-03 Thread brian . kejser
Hey

Thanks but that didn't help.

Do you have any other suggestions?

By the way, I'm using php 5.1.6 and mysql 5.0.24a.




-Original Message-
From: [EMAIL PROTECTED]
Sent: Tue, October 3, 2006 11:52
To: [EMAIL PROTECTED], php-db@lists.php.net
Subject: re: [PHP-DB] Php 5 and Mysql on Windows

Hi Brian...

My guess is that you want to take the period out from in front of the
/ext parm... This says look one  directory higher than  that of 
/php... for a folder called /ext

Here is my extension_dir entry:  extension_dir = c:/WebServ/php/ext/

Scot L. Diddle, Richmond VA, 804.231.8407


From: [EMAIL PROTECTED]
Sent: Tuesday, October 03, 2006 7:22 PM
To: php-db@lists.php.net
Subject: [PHP-DB] Php 5 and Mysql on Windows

Hi

I setup Php as follows:

1. Download the php zip file (not the installer)
2. Unzip the files to c:\Php
3. Add c:\php to the path
4. Copy php.ini-dist to php.ini
5. Add and enable the web extension php5isapi.dll
6. Add the .php extension mapping to php5isapi.dll at the the web sites
folder
7. Grant everyone read access to c:\php
8. Enable the mysql extension in php.ini
9. Set the extension_dir in php.ini to ./ext
10. Reboot

I setup Mysql as follows:

1. Download the 5.x installer
2. Run the installer
3. Run the configuration tool ater the installer

When I run the following script, the error Fatal error: Call to
undefined function mysql_connect() in Test.php on line 3 is returned.

$conn = mysql_connect('localhost', 'root', 'password')

?

Any help would be appreciated.

Thanks

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

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



Re: [PHP-DB] Php 5 and Mysql on Windows

2006-10-03 Thread brian . kejser
Hey

I'm using IIS on W2K3 SP1, php 5.1.6 and mysql 5.0.24a.







-Original Message-
From: Alejandro Tesone [EMAIL PROTECTED]
Sent: Tue, October 3, 2006 12:25
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Php 5 and Mysql on Windows

Which server you will use? Apache or Microsoft?

On 10/3/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 Hi

 I setup Php as follows:

 1. Download the php zip file (not the installer)
 2. Unzip the files to c:\Php
 3. Add c:\php to the path
 4. Copy php.ini-dist to php.ini
 5. Add and enable the web extension php5isapi.dll
 6. Add the .php extension mapping to php5isapi.dll at the the web sites
 folder
 7. Grant everyone read access to c:\php
 8. Enable the mysql extension in php.ini
 9. Set the extension_dir in php.ini to ./ext
 10. Reboot

 I setup Mysql as follows:

 1. Download the 5.x installer
 2. Run the installer
 3. Run the configuration tool ater the installer

 When I run the following script, the error Fatal error: Call to
 undefined function mysql_connect() in Test.php on line 3  is returned.

 ?php

 $conn = mysql_connect('localhost', 'root', 'password')

 ?

 Any help would be appreciated.

 Thanks

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



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



Re: [PHP-DB] Php 5 and Mysql on Windows

2006-10-03 Thread Stut
[EMAIL PROTECTED] wrote:
 I setup Mysql as follows:
 
 1. Download the 5.x installer
 2. Run the installer
 3. Run the configuration tool ater the installer
 
 When I run the following script, the error Fatal error: Call to
 undefined function mysql_connect() in Test.php on line 3  is returned.
 
 $conn = mysql_connect('localhost', 'root', 'password')

Installing MySQL is not enough - you need to enable the mysql extension
in your php.ini.

-Stut

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



Re: [PHP-DB] Php 5 and Mysql on Windows

2006-10-03 Thread brian . kejser
Hey

I did that already. Step (8) of setting up php.

Do I need to move any files around or add anything else to the path?




-Original Message-
From: Stut [EMAIL PROTECTED]
Sent: Tue, October 3, 2006 14:12
To: [EMAIL PROTECTED]
Cc: php-db@lists.php.net
Subject: Re: [PHP-DB] Php 5 and Mysql on Windows

[EMAIL PROTECTED] wrote:
 I setup Mysql as follows:

 1. Download the 5.x installer
 2. Run the installer
 3. Run the configuration tool ater the installer

 When I run the following script, the error Fatal error: Call to
 undefined function mysql_connect() in Test.php on line 3  is returned.

 $conn = mysql_connect('localhost', 'root', 'password')

Installing MySQL is not enough - you need to enable the mysql extension
in your php.ini.

-Stut

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

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



Re: [PHP-DB] Php 5 and Mysql on Windows

2006-10-03 Thread Dave W

You might want to try php.ini-recommended instead of php.ini-dist.

On 10/3/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:


Hey

I did that already. Step (8) of setting up php.

Do I need to move any files around or add anything else to the path?




-Original Message-
From: Stut [EMAIL PROTECTED]
Sent: Tue, October 3, 2006 14:12
To: [EMAIL PROTECTED]
Cc: php-db@lists.php.net
Subject: Re: [PHP-DB] Php 5 and Mysql on Windows

[EMAIL PROTECTED] wrote:
 I setup Mysql as follows:

 1. Download the 5.x installer
 2. Run the installer
 3. Run the configuration tool ater the installer

 When I run the following script, the error Fatal error: Call to
 undefined function mysql_connect() in Test.php on line 3  is returned.

 $conn = mysql_connect('localhost', 'root', 'password')

Installing MySQL is not enough - you need to enable the mysql extension
in your php.ini.

-Stut

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

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





--
Dave W


Re: [PHP-DB] Php 5 and Mysql on Windows

2006-10-03 Thread Niel Archer
Hi

Make sure that the php.ini file being used is the one you thinkit is.

I keep mine in the php directory, so I have to be very careful that I
don't accidentally let one get into the Windows folder, becuase that is
search first

The manual lists the search order. It also has some notes on setting up
IIS and where to put the php5isapi.dll so it is found

Niel

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



Re: [PHP-DB] Php 5 and Mysql on Windows

2006-10-03 Thread brian . kejser
Hey

I tried that but I still get the error.





-Original Message-
From: Dave W [EMAIL PROTECTED]
Sent: Tue, October 3, 2006 14:33
To: [EMAIL PROTECTED]
Cc: php-db@lists.php.net
Subject: Re: [PHP-DB] Php 5 and Mysql on Windows

You might want to try php.ini-recommended instead of php.ini-dist.

On 10/3/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 Hey

 I did that already. Step (8) of setting up php.

 Do I need to move any files around or add anything else to the path?




 -Original Message-
 From: Stut [EMAIL PROTECTED]
 Sent: Tue, October 3, 2006 14:12
 To: [EMAIL PROTECTED]
 Cc: php-db@lists.php.net
 Subject: Re: [PHP-DB] Php 5 and Mysql on Windows

 [EMAIL PROTECTED] wrote:
  I setup Mysql as follows:
 
  1. Download the 5.x installer
  2. Run the installer
  3. Run the configuration tool ater the installer
 
  When I run the following script, the error Fatal error: Call to
  undefined function mysql_connect() in Test.php on line 3  is returned.
 
  $conn = mysql_connect('localhost', 'root', 'password')

 Installing MySQL is not enough - you need to enable the mysql extension
 in your php.ini.

 -Stut

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

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




-- 
Dave W

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



Re: [PHP-DB] Php 5 and Mysql on Windows

2006-10-03 Thread Frank M. Kromann
IIRC: When you are using ISAPI you must have php,ini in the windows
directory.

If you are using CGI you can have it in the same directory as all other
PHP files.

- Frank

 Hi
 
 Make sure that the php.ini file being used is the one you thinkit is.
 
 I keep mine in the php directory, so I have to be very careful that I
 don't accidentally let one get into the Windows folder, becuase that is
 search first
 
 The manual lists the search order. It also has some notes on setting up
 IIS and where to put the php5isapi.dll so it is found
 
 Niel
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

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



RE: [PHP-DB] How to stop the server timing out

2006-10-03 Thread Bastien Koert
You need to just start adding echo statements to the code to see where the 
hang up is


Bastien



From: David Skyers [EMAIL PROTECTED]
To: php-db@lists.php.net
Subject: [PHP-DB] How to stop the server timing out
Date: Tue, 3 Oct 2006 11:51:30 +0100

Hi,

I have written a php page and every time I run it, it causes the server
to times-out. Is there anything I can do, to get the page to run
completely or speed up how the page works. Please note I do not have any
control over the server.

The page does a select from a table and inserts the data into another
table. However it times-out half way through inserting.

The code is attached.

Thanks,

David


David Skyers
Support Analyst
Management Systems, EISD, UCL
Extension: 41849
Tel: 020 7679 1849
Email: [EMAIL PROTECTED]






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


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



Re: [PHP-DB] Php 5 and Mysql on Windows

2006-10-03 Thread brian . kejser
Wow

That solved it. Awesome. Thanks you so much.




-Original Message-
From: Frank M. Kromann [EMAIL PROTECTED]
Sent: Tue, October 3, 2006 19:20
To: php-db@lists.php.net
Subject: Re: [PHP-DB] Php 5 and Mysql on Windows

IIRC: When you are using ISAPI you must have php,ini in the windows
directory.

If you are using CGI you can have it in the same directory as all other
PHP files.

- Frank

 Hi

 Make sure that the php.ini file being used is the one you thinkit is.

 I keep mine in the php directory, so I have to be very careful that I
 don't accidentally let one get into the Windows folder, becuase that is
 search first

 The manual lists the search order. It also has some notes on setting up
 IIS and where to put the php5isapi.dll so it is found

 Niel

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


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

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