php-general Digest 19 Mar 2007 00:10:39 -0000 Issue 4684

Topics (messages 250770 through 250791):

Re: works at command line but not in apache
        250770 by: Jim Lucas
        250771 by: Tijnema !
        250773 by: Jim Lucas

Re: glob(path_pattern, GLOB_ONLYDIR)
        250772 by: Jim Lucas
        250782 by: Al
        250783 by: Jim Lucas
        250784 by: Jochem Maas
        250786 by: Al
        250789 by: Al

install php 5.2.1 with checkinstall
        250774 by: Tiron Adrian
        250776 by: Man-wai Chang
        250777 by: Man-wai Chang

Preventing unwanted chars from outputting
        250775 by: Don Don
        250785 by: Haydar TUNA
        250787 by: Larry Garfield
        250788 by: Robert Cummings
        250790 by: Larry Garfield

Re: Getting last record ID created from DB
        250778 by: markw.mohawksoft.com
        250779 by: Satyam

phpPgAdmin - prior version available?
        250780 by: Bob Hartung
        250781 by: Tijnema !

install problems
        250791 by: jekillen

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [email protected]


----------------------------------------------------------------------
--- Begin Message ---
rwhartung wrote:
Hi,
  I have this short php script: [op;ening <?php and closing ?> removed.


$db = pg_connect('dbname=bpsimple user=minitwr password=RWHart') ;
print $db . "<br />" . "\n" ;
if ($db)
{
    print 'Connection attempt succeeded.' . "<br />" . "\n" ;
} else
{
    print 'Connection attempt failed.'. "<br />" . "\n" ;
}

$query = 'SELECT fname, lname FROM customer' ;
$result = pg_query($db, $query) ;
while($myrow = pg_fetch_assoc($result) )
{
    print $myrow['fname'] . " " . $myrow['lname']  . "\n" ;
}

This works fine as a PHP script from the command line, but wrapped up in <html> </html> tags it refuses to connect with the database from within apache. All connections are local host. PHP otherwise works fine on the apache server and the code is identical on both the CL script and the test.php web page. Ideas? Where to start looking?

TIA

Bob

well, how about showing us the code that doesn't work also, I know you said it was the same, but what you have here is an incomplete script.

Show us the entire script that you are using from the cli and the web.

Also, give us the error, if any, that you are getting from the web script.

Jim

--- End Message ---
--- Begin Message ---
On 3/18/07, rwhartung <[EMAIL PROTECTED]> wrote:
Thanks, but I have these changes in and it still will not connect:
file:  pg_hba.conf:
# IPv4 local connections:
host    all         all         127.0.0.1/32          ident sameuser

postgrsql.conf:
  listen_addresses = 'localhost'
  port = 5432

It is my understanding that the current version 8.1+ now uses the
generalized 'listen_addresses' in postgresql.conf instead of any tcp* =
'true' statements in this file.

I also am assuming that the postgresql.conf file being read is that in
the /var/lib/pgsql/data directory.

I am connecting to localhost, need to make sure I can configure for
tcpip, and am trying to login as a local user with a user account on the
machine.

Other ideas?  I am not having much luck finding more in the docs.

TIA

Bob

So, you want it to run through TCP/IP, then you need to add the
host=localhost and port=5432 items to your pg_connect string
$db = pg_connect('dbname=bpsimple user=minitwr password=RWHart') ;
becomes:
$db = pg_connect('host=localhost port=5432 dbname=bpsimple
user=minitwr password=RWHart') ;



Tijnema ! wrote:
> On 3/17/07, rwhartung <[EMAIL PROTECTED]> wrote:
>> Hi,
>>   I have this short php script: [op;ening <?php and closing ?> removed.
>>
>>
>> $db = pg_connect('dbname=bpsimple user=minitwr password=RWHart') ;
>
>> print $db . "<br />" . "\n" ;
>> if ($db)
>> {
>>        print 'Connection attempt succeeded.' . "<br />" . "\n" ;
>> } else
>> {
>>        print 'Connection attempt failed.'. "<br />" . "\n" ;
>> }
>>
>> $query = 'SELECT fname, lname FROM customer' ;
>> $result = pg_query($db, $query) ;
>> while($myrow = pg_fetch_assoc($result) )
>> {
>>        print $myrow['fname'] . " " . $myrow['lname']  . "\n" ;
>> }
>>
>> This works fine as a PHP script from the command line, but wrapped up in
>> <html> </html> tags it refuses to connect with the database from within
>> apache.  All connections are local host.  PHP otherwise works fine on
>> the apache server and the code is identical on both the CL script and
>> the test.php web page.  Ideas?  Where to start looking?
>>
>> TIA
>>
>> Bob
>
> One of the comments in the PHP Manual says this:
>
> If you use pg_connect('host=localhost port=5432 user=my_username
> password=my_password dbname=my_dbname') and you get the following
> error:
> "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?"
> then you should try to leave the host= and port= parts out of the
> connection string. This sounds strange, but this is an "option" of
> Postgre. If you have not activated the TCP/IP port in postgresql.conf
> then postgresql doesn't accept any incoming requests from an TCP/IP
> port. If you use host= in your connection string you are going to
> connect to Postgre via TCP/IP, so that's not going to work. If you
> leave the host= part out of your connection string you connect to
> Postgre via the Unix domain sockets, which is faster and more secure,
> but you can't connect with the database via any other PC as the
> localhost.
>
> I think that's what your problem is also, but not sure about it.
> (using MySQL mostly)
>
> Tijnema
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>


--- End Message ---
--- Begin Message ---
Tijnema ! wrote:
On 3/18/07, rwhartung <[EMAIL PROTECTED]> wrote:
Thanks, but I have these changes in and it still will not connect:
file:  pg_hba.conf:
# IPv4 local connections:
host    all         all         127.0.0.1/32          ident sameuser

postgrsql.conf:
  listen_addresses = 'localhost'
  port = 5432

It is my understanding that the current version 8.1+ now uses the
generalized 'listen_addresses' in postgresql.conf instead of any tcp* =
'true' statements in this file.

I also am assuming that the postgresql.conf file being read is that in
the /var/lib/pgsql/data directory.

I am connecting to localhost, need to make sure I can configure for
tcpip, and am trying to login as a local user with a user account on the
machine.

Other ideas?  I am not having much luck finding more in the docs.

TIA

Bob

So, you want it to run through TCP/IP, then you need to add the
host=localhost and port=5432 items to your pg_connect string
$db = pg_connect('dbname=bpsimple user=minitwr password=RWHart') ;
becomes:
$db = pg_connect('host=localhost port=5432 dbname=bpsimple
user=minitwr password=RWHart') ;

if you think it is the pg_connect() call that is causing problems, then do this. It is crude way to debug, but it will work.

$db = pg_connect('host=localhost port=5432 dbname=bpsimple user=minitwr password=RWHart') or die('error' . pg_last_error());

if the pg_connect is causing the error, then this should give you a clue as to where the problem it.




Tijnema ! wrote:
> On 3/17/07, rwhartung <[EMAIL PROTECTED]> wrote:
>> Hi,
>> I have this short php script: [op;ening <?php and closing ?> removed.
>>
>>
>> $db = pg_connect('dbname=bpsimple user=minitwr password=RWHart') ;
>
>> print $db . "<br />" . "\n" ;
>> if ($db)
>> {
>>        print 'Connection attempt succeeded.' . "<br />" . "\n" ;
>> } else
>> {
>>        print 'Connection attempt failed.'. "<br />" . "\n" ;
>> }
>>
>> $query = 'SELECT fname, lname FROM customer' ;
>> $result = pg_query($db, $query) ;
>> while($myrow = pg_fetch_assoc($result) )
>> {
>>        print $myrow['fname'] . " " . $myrow['lname']  . "\n" ;
>> }
>>
>> This works fine as a PHP script from the command line, but wrapped up in >> <html> </html> tags it refuses to connect with the database from within
>> apache.  All connections are local host.  PHP otherwise works fine on
>> the apache server and the code is identical on both the CL script and
>> the test.php web page.  Ideas?  Where to start looking?
>>
>> TIA
>>
>> Bob
>
> One of the comments in the PHP Manual says this:
>
> If you use pg_connect('host=localhost port=5432 user=my_username
> password=my_password dbname=my_dbname') and you get the following
> error:
> "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?"
> then you should try to leave the host= and port= parts out of the
> connection string. This sounds strange, but this is an "option" of
> Postgre. If you have not activated the TCP/IP port in postgresql.conf
> then postgresql doesn't accept any incoming requests from an TCP/IP
> port. If you use host= in your connection string you are going to
> connect to Postgre via TCP/IP, so that's not going to work. If you
> leave the host= part out of your connection string you connect to
> Postgre via the Unix domain sockets, which is faster and more secure,
> but you can't connect with the database via any other PC as the
> localhost.
>
> I think that's what your problem is also, but not sure about it.
> (using MySQL mostly)
>
> Tijnema
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>



--- End Message ---
--- Begin Message ---
Al wrote:
I can't use flag "GLOB_ONLYDIR" to work on a Linux, php4.4.4. I only want the dirs.

This works; sort of:
print_r(glob('../*',)); //It lists all the files AND directories. Yet it seems to ignore the lack of ".*" and finds xxx.yyy. That's OK, I can delete the files
remember this is linux you are talking about, not windows.

A '*' means anything, including a '.'



This fails:
print_r(glob('../*', GLOB_ONLYDIR));
well, double check your php version, because this should be built in whit the version that you are running.


And I get: "Warning: glob() expects parameter 2 to be long, string given in foo"

I can't find anything in the manual or when Googling.

Anyone can explain this for me?


--- End Message ---
--- Begin Message ---
I thought the "." had meaning since the manual user notes used it

Definitely, my php is version 4.4.4; it's on a virtual host.

I found the glob file for the GNU C Library and GLOB_ONLYDIR doesn't seem to be defined correctly, the file appears to rather old.

I used the numerical value "8196" and it works fine. I'm a little reluctant to use the numerical value as I want my code to be generally universal. Maybe the numerical value is safer anyhow. What do you think?

I can alternatively just filter out the files in a second step.

Al.............



Jim Lucas wrote:
Al wrote:
I can't use flag "GLOB_ONLYDIR" to work on a Linux, php4.4.4. I only want the dirs.

This works; sort of:
print_r(glob('../*',)); //It lists all the files AND directories. Yet it seems to ignore the lack of ".*" and finds xxx.yyy. That's OK, I can delete the files
remember this is linux you are talking about, not windows.

A '*' means anything, including a '.'



This fails:
print_r(glob('../*', GLOB_ONLYDIR));
well, double check your php version, because this should be built in whit the version that you are running.


And I get: "Warning: glob() expects parameter 2 to be long, string given in foo"

I can't find anything in the manual or when Googling.

Anyone can explain this for me?


--- End Message ---
--- Begin Message ---
Al wrote:
I thought the "." had meaning since the manual user notes used it

Definitely, my php is version 4.4.4; it's on a virtual host.

I found the glob file for the GNU C Library and GLOB_ONLYDIR doesn't seem to be defined correctly, the file appears to rather old.


echo GLOB_ONLYDIR;

does this work?


I used the numerical value "8196" and it works fine. I'm a little reluctant to use the numerical value as I want my code to be generally universal. Maybe the numerical value is safer anyhow. What do you think?

I can alternatively just filter out the files in a second step.

Al.............



Jim Lucas wrote:
Al wrote:
I can't use flag "GLOB_ONLYDIR" to work on a Linux, php4.4.4. I only want the dirs.

This works; sort of:
print_r(glob('../*',)); //It lists all the files AND directories. Yet it seems to ignore the lack of ".*" and finds xxx.yyy. That's OK, I can delete the files
remember this is linux you are talking about, not windows.

A '*' means anything, including a '.'



This fails:
print_r(glob('../*', GLOB_ONLYDIR));
well, double check your php version, because this should be built in whit the version that you are running.


And I get: "Warning: glob() expects parameter 2 to be long, string given in foo"

I can't find anything in the manual or when Googling.

Anyone can explain this for me?



--- End Message ---
--- Begin Message ---
Al wrote:
> I thought the "." had meaning since the manual user notes used it

it means a literal dot, many people assume that glob expressions
use the same syntax as regular expressions but this is not the case.

> 
> Definitely, my php is version 4.4.4; it's on a virtual host.
> 
> I found the glob file for the GNU C Library and GLOB_ONLYDIR doesn't
> seem to be defined correctly, the file appears to rather old.
> 
> I used the numerical value "8196" and it works fine.  I'm a little
> reluctant to use the numerical value as I want my code to be generally
> universal.  Maybe the numerical value is safer anyhow.  What do you think?

you might consider something like this:

if (!defined('GLOB_ONLYDIR'))
        define('GLOB_ONLYDIR',  8196);

I doubt that the numeric value will ever change btw.

> 
> I can alternatively just filter out the files in a second step.

that seems like a lesser solution.

> 
> Al.............
> 
> 
> 
> Jim Lucas wrote:
>> Al wrote:
>>> I can't use flag "GLOB_ONLYDIR" to work on a Linux, php4.4.4.  I only
>>> want the dirs.
>>>
>>> This works; sort of:
>>> print_r(glob('../*',));  //It lists all the files AND directories.
>>> Yet it seems to ignore the lack of ".*" and finds xxx.yyy. That's OK,
>>> I can delete the files
>> remember this is linux you are talking about, not windows.
>>
>> A '*' means anything, including a '.'
>>
>>
>>>
>>> This fails:
>>> print_r(glob('../*', GLOB_ONLYDIR));
>> well, double check your php version, because this should be built in
>> whit the version that you are running.
>>
>>>
>>> And I get: "Warning: glob() expects parameter 2 to be long, string
>>> given in foo"
>>>
>>> I can't find anything in the manual or when Googling.
>>>
>>> Anyone can explain this for me?
>>>
> 

--- End Message ---
--- Begin Message ---
That nailed my problem.  GLOB_ONLYDIR is a defined constant. It echos as 8192.

I inadvertently treated it as a string with quotes, which I didn't include in my original post.

I had forgotten that most function flags are simply constants which can be tested for and printed, etc.

Many thanks....

Jim Lucas wrote:
Al wrote:
I thought the "." had meaning since the manual user notes used it

Definitely, my php is version 4.4.4; it's on a virtual host.

I found the glob file for the GNU C Library and GLOB_ONLYDIR doesn't seem to be defined correctly, the file appears to rather old.


echo GLOB_ONLYDIR;

does this work?


I used the numerical value "8196" and it works fine. I'm a little reluctant to use the numerical value as I want my code to be generally universal. Maybe the numerical value is safer anyhow. What do you think?

I can alternatively just filter out the files in a second step.

Al.............



Jim Lucas wrote:
Al wrote:
I can't use flag "GLOB_ONLYDIR" to work on a Linux, php4.4.4. I only want the dirs.

This works; sort of:
print_r(glob('../*',)); //It lists all the files AND directories. Yet it seems to ignore the lack of ".*" and finds xxx.yyy. That's OK, I can delete the files
remember this is linux you are talking about, not windows.

A '*' means anything, including a '.'



This fails:
print_r(glob('../*', GLOB_ONLYDIR));
well, double check your php version, because this should be built in whit the version that you are running.


And I get: "Warning: glob() expects parameter 2 to be long, string given in foo"

I can't find anything in the manual or when Googling.

Anyone can explain this for me?



--- End Message ---
--- Begin Message ---
It doesn't on my Linux system
glob("../path/*"); shows files and dirs;  foo.ext and dirs

Exactly the same as glob("../path/*.*"); I thought using just plain "*" would ignore files; but, it doesn't.


Jochem Maas wrote:
Al wrote:
I thought the "." had meaning since the manual user notes used it

it means a literal dot, many people assume that glob expressions
use the same syntax as regular expressions but this is not the case.

Definitely, my php is version 4.4.4; it's on a virtual host.

I found the glob file for the GNU C Library and GLOB_ONLYDIR doesn't
seem to be defined correctly, the file appears to rather old.

I used the numerical value "8196" and it works fine.  I'm a little
reluctant to use the numerical value as I want my code to be generally
universal.  Maybe the numerical value is safer anyhow.  What do you think?

you might consider something like this:

if (!defined('GLOB_ONLYDIR'))
        define('GLOB_ONLYDIR',  8196);

I doubt that the numeric value will ever change btw.

I can alternatively just filter out the files in a second step.

that seems like a lesser solution.

Al.............



Jim Lucas wrote:
Al wrote:
I can't use flag "GLOB_ONLYDIR" to work on a Linux, php4.4.4.  I only
want the dirs.

This works; sort of:
print_r(glob('../*',));  //It lists all the files AND directories.
Yet it seems to ignore the lack of ".*" and finds xxx.yyy. That's OK,
I can delete the files
remember this is linux you are talking about, not windows.

A '*' means anything, including a '.'


This fails:
print_r(glob('../*', GLOB_ONLYDIR));
well, double check your php version, because this should be built in
whit the version that you are running.

And I get: "Warning: glob() expects parameter 2 to be long, string
given in foo"

I can't find anything in the manual or when Googling.

Anyone can explain this for me?


--- End Message ---
--- Begin Message ---
Hello,
 

I have php 5.1.6 ,the latest available with yum and i wanted to upgrade to 5.2.1

I have downloade 5.2.1 run ./configure,make and the checkinstall. When i wanted 
to install the newly created rpm i got the following errors:
 

# rpm -ivh php-5.2.1-1.i386.rpm 

Preparing...                ########################################### [100%]

        file /etc/pear.conf from install of php-5.2.1-1 conflicts with file 
from package php-pear-1.4.9-4

file /usr/share/pear/.channels/pear.php.net.reg from install of
php-5.2.1-1 conflicts with file from package php-pear-1.4.9-4

        file /usr/share/pear/.depdb from install of php-5.2.1-1 conflicts with 
file from package php-pear-1.4.9-4

file /usr/share/pear/.registry/archive_tar.reg from install of
php-5.2.1-1 conflicts with file from package php-pear-1.4.9-4

file /usr/share/pear/.registry/console_getopt.reg from install of
php-5.2.1-1 conflicts with file from package php-pear-1.4.9-4

        file /usr/share/pear/.registry/pear.reg from install of php-5.2.1-1 
conflicts with file from package php-pear-1.4.9-4

        file /usr/bin/php from install of php-5.2.1-1 conflicts with file from 
package php-cli-5.1.6-3.4.fc6

        file /usr/share/man/man1/php.1.gz from install of php-5.2.1-1 conflicts 
with file from package php-cli-5.1.6-3.4.fc6
 
 

Is it safe to use the --force option?

just in case this is the output of rpm -qa | grep php on my machine(i thought 
it would be useful)
 

rpm -qa | grep php

php-5.1.6-3.4.fc6

php-pear-Date-1.4.7-1.fc6

php-cli-5.1.6-3.4.fc6

php-mbstring-5.1.6-3.4.fc6

php-pear-DB-1.7.6-7.fc6

php-common-5.1.6-3.4.fc6

php-pear-1.4.9-4

php-mysql-5.1.6-3.4.fc6

php-pear-DB-DataObject-1.8.5-2.fc6

php-pear-Validate-0.7.0-1.fc6

php-pear-MDB2-2.4.0-1.fc6

php-pdo-5.1.6-3.4.fc6
 

So as you can see php,php-cli,php-mbstring and php-mysql are the same version : 
5.1.6

If i install JUST php 5.2.1 wouldn't that break the dependencies with the other 
packages?
 

Thanks.



 
____________________________________________________________________________________
Bored stiff? Loosen up... 
Download and play hundreds of games for free on Yahoo! Games.
http://games.yahoo.com/games/front

--- End Message ---
--- Begin Message ---
> # rpm -ivh php-5.2.1-1.i386.rpm 
>         file /etc/pear.conf from install of php-5.2.1-1 conflicts with file 
> from package php-pear-1.4.9-4
> file /usr/share/pear/.channels/pear.php.net.reg from install of
> php-5.2.1-1 conflicts with file from package php-pear-1.4.9-4
>         file /usr/share/pear/.depdb from install of php-5.2.1-1 conflicts 
> with file from package php-pear-1.4.9-4

I suggest you use `rpm -r` to remove the original php package in your linux.

-- 
  .~.   Might, Courage, Vision, SINCERITY. http://www.linux-sxs.org
 / v \  Simplicity is Beauty! May the Force and Farce be with you!
/( _ )\ (Ubuntu 6.10)  Linux 2.6.20.3
  ^ ^   19:00:01 up 5:18 0 users load average: 1.00 1.00 1.00
news://news.3home.net news://news.hkpcug.org news://news.newsgroup.com.hk

--- End Message ---
--- Begin Message ---
In case you want a full ./configure line...

#!/bin/bash

./configure \
--prefix=/usr \
--sysconfdir=/etc \
--with-config-file-path=/etc \
--enable-track-vars \
--enable-ftp \
--enable-sysvsem \
--enable-sysvshm \
--enable-sockets \
--enable-gd-native-ttf \
--enable-memory-limit \
--enable-trans-sid \
--enable-magic-quotes \
--enable-exif \
--enable-inline-optimization \
--enable-dbase \
--enable-mbstring \
--enable-embedded-mysqli \
--with-mysqli \
--with-gettext \
--with-gd \
--with-calendar=shared \
--with-apxs2=`which apxs2` \
--with-imap \
--with-ncurses \
--with-zlib-dir=/usr \
--with-jpeg-dir=/usr \
--with-png-dir=/usr \
--with-xpm-dir=/usr \
--with-openssl=/usr \
--with-freetype-dir=/usr/include \
--with-mysql=/usr \
--with-kerberos \
--with-imap-ssl

#
# --with-ldap \
# --with-ttf=/usr/X11R6 \
# --with-mm=/usr/mm-1.1.3 \
# --with-pgsql=/usr/local/pgsql \
# --with-pdflib=/usr/local \
#

make

echo -n "Remember to back up /etc/apache/httpd.conf first"
exit
# make install



-- 
  .~.   Might, Courage, Vision, SINCERITY. http://www.linux-sxs.org
 / v \  Simplicity is Beauty! May the Force and Farce be with you!
/( _ )\ (Ubuntu 6.10)  Linux 2.6.20.3
  ^ ^   19:57:01 up 6:15 0 users load average: 1.10 1.05 1.01
news://news.3home.net news://news.hkpcug.org news://news.newsgroup.com.hk

--- End Message ---
--- Begin Message ---
Hi all, 
  my program outputs some characters along with text from the database, these 
texts contain chars like ‘ ’.  How can i get rid of theses chars and 
display their meaning instead ?  I am thinking htmlspecialchars or html 
entities will do the job will it ?
   
   
  Cheers

 
---------------------------------
Food fight? Enjoy some healthy debate
in the Yahoo! Answers Food & Drink Q&A.

--- End Message ---
--- Begin Message ---
Hello,
      What is your database program? If your database program is MySQL, what 
is your default charset of database? These questions are more importont to 
solve your problem.:)

-- 
Haydar TUNA
Republic Of Turkey - Ministry of National Education
Education Technology Department Ankara / TURKEY
Web: http://www.haydartuna.net

"Don Don" <[EMAIL PROTECTED]>, haber iletisinde sunlari 
yazdi:[EMAIL PROTECTED]
> Hi all,
>  my program outputs some characters along with text from the database, 
> these texts contain chars like â?~ â?T.  How can i get rid of theses chars 
> and display their meaning instead ?  I am thinking htmlspecialchars or 
> html entities will do the job will it ?
>
>
>  Cheers
>
>
> ---------------------------------
> Food fight? Enjoy some healthy debate
> in the Yahoo! Answers Food & Drink Q&A. 

--- End Message ---
--- Begin Message ---
On Sunday 18 March 2007 5:57 am, Don Don wrote:
> Hi all,
>   my program outputs some characters along with text from the database,
> these texts contain chars like ‘ ’.  How can i get rid of theses chars
> and display their meaning instead ?  I am thinking htmlspecialchars or html
> entities will do the job will it ?
>
>
>   Cheers

It sounds like you're running into character encoding issues.  They suck. :-)  
See here for details:

http://www.garfieldtech.com/blog/stupid-quotes
http://www.garfieldtech.com/blog/more-on-stupid-quotes
http://www.garfieldtech.com/blog/unicode-8-vs-16

-- 
Larry Garfield                  AIM: LOLG42
[EMAIL PROTECTED]               ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson

--- End Message ---
--- Begin Message ---
On Sun, 2007-03-18 at 13:58 -0500, Larry Garfield wrote:
> On Sunday 18 March 2007 5:57 am, Don Don wrote:
> > Hi all,
> >   my program outputs some characters along with text from the database,
> > these texts contain chars like ‘ ’.  How can i get rid of theses chars
> > and display their meaning instead ?  I am thinking htmlspecialchars or html
> > entities will do the job will it ?
> >
> >
> >   Cheers
> 
> It sounds like you're running into character encoding issues.  They suck. :-) 
>  
> See here for details:
> 
> http://www.garfieldtech.com/blog/stupid-quotes
> http://www.garfieldtech.com/blog/more-on-stupid-quotes
> http://www.garfieldtech.com/blog/unicode-8-vs-16

I found the following to be quite informative:

    http://www.joelonsoftware.com/articles/Unicode.html

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

--- End Message ---
--- Begin Message ---
On Sunday 18 March 2007 2:17 pm, Robert Cummings wrote:
> On Sun, 2007-03-18 at 13:58 -0500, Larry Garfield wrote:
> > On Sunday 18 March 2007 5:57 am, Don Don wrote:
> > > Hi all,
> > >   my program outputs some characters along with text from the database,
> > > these texts contain chars like ‘ ’.  How can i get rid of theses
> > > chars and display their meaning instead ?  I am thinking
> > > htmlspecialchars or html entities will do the job will it ?
> > >
> > >
> > >   Cheers
> >
> > It sounds like you're running into character encoding issues.  They suck.
> > :-) See here for details:
> >
> > http://www.garfieldtech.com/blog/stupid-quotes
> > http://www.garfieldtech.com/blog/more-on-stupid-quotes
> > http://www.garfieldtech.com/blog/unicode-8-vs-16
>
> I found the following to be quite informative:
>
>     http://www.joelonsoftware.com/articles/Unicode.html

I do like Joel's style... :-)

-- 
Larry Garfield                  AIM: LOLG42
[EMAIL PROTECTED]               ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson

--- End Message ---
--- Begin Message ---
> [email protected] wrote:
>>> On Sat, 2007-03-17 at 12:19 -0400, Mark wrote:

>> There in lies the biggest problem with LAMP, and that's MySQL. The
>> architecture of your methodology *only* works with MySQL, and not more
>> capable databases like Oracle, DB2, or even PostgreSQL.
> I too thought the same thing, but was corrected when I starting working
> on a redesign for the billing system for the company that I am working
> for.  They use PostgreSQL and we do have a auto incremented unique id
> field.  It isn't call AUTO_INCREMENT, but rather a sequence value.  It
> is a value that is controlled by the default value entry.
>
> It then runs this:
>       nextval('customers_customer_id_seq'::regclass)
>
> and uses this as the value of the id field for the newly inserted row.

Yea, I've been using PG for over 10 years now. Sequences are awesome, but
there have an "auto number" column type as well. It simply creates a
sequence but it's there.

I guess maybe most databases support the notion of "auto number" in some
form. I haven't used MSSQL recently, but I think their solution is a GUID.

>
> Then instead of running a command like SELECT LAST_INSERT_ID(); you have
> to do some other stuff like this:
>
> $SQL = "SELECT currval('{$table}_{$column}_seq');";


Again, this is absolutely wrong unless it is wrapped in a transaction. You
will need a "begin" and a "commit" in an MVCC type system. If you don't
wrap it in a transaction you don't know who got the last "nextval" of the
sequence. Also, in PostgreSQL, the pre-cache sequence values for
performance. So sequences are not always sequential.
(pseudo code)
begin;
insert ... values (...);
select currval('sequence_name');
commit;

or

$foo = select nextval('user_id_sequence');
insert into users(user_id, ...) values ($foo, ...)

(Without a transaction)

Sequences are far more flexible than auto number, don't you think?


--- End Message ---
--- Begin Message ---

----- Original Message ----- From: <[email protected]>

I guess maybe most databases support the notion of "auto number" in some
form. I haven't used MSSQL recently, but I think their solution is a GUID.


You can set an auto-increment attribute on any integer data type. They also have GUIDs, which they recomend using if you plan on using replication, as any autonumeric sequence is local to each database and there will be repetitions over multiple servers, something GUIDs won't.

Satyam

--- End Message ---
--- Begin Message ---
Hi all,
I have been struggling with phpPgAdmin 4.1 - login failures. There does not yet seem to be a fix. Where can I find a prior version for FC6 - rpm, tar.gz etc.

Thanks,

Bob

--- End Message ---
--- Begin Message ---
On 3/18/07, Bob Hartung <[EMAIL PROTECTED]> wrote:
Hi all,
  I have been struggling with phpPgAdmin 4.1 - login failures.  There
does not yet seem to be a fix.  Where can I find a prior version for FC6
- rpm, tar.gz etc.

Thanks,

Bob

Try this one, 
http://ftp.uni-koeln.de/mirrors/fedora/linux/extras/6/ppc/phpPgAdmin-4.0.1-7.fc6.noarch.rpm

phpPgAdmin 4.0.1

Tijnema

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



--- End Message ---
--- Begin Message ---
Hello;
Well, this one I cannot seem to figure out:
I installed Apache 1.3.37 with
./configure --enable-module=so --enable-module=rewrite --enable-shared=max
Then tried to install
php 5.2.1 --with-apxs=/usr/local/apache/bin etc etc

libphp5.so is no where to be found. It sure is not
in apache/libexec

I saved the ./configure options in a file and had
configure read from it. All seemed to go ok,
no errors, bailouts. I can send that file if anyone
thinks it may have the answer.

The problem showed up when I tried to start apache and
it would not start because it could not find libphp5.so

OS: Freebsd 6.2
(I know there is the ports system, I have install all of this successfully on two other machines doing just untar, configure, make, make install. I had
 reasons for not dealing with ports)
Any clues?
Thanks in advance
Jeff K

--- End Message ---

Reply via email to