Re: [PHP-DB] replace question

2005-05-13 Thread Chris
Chris Payne wrote:
Hi there everyone,

I'm pulling some sensitive data from a MySQL DB with PHP and the clients
wants the first x amount of numbers displayed on the screen to be xx etc
... rather than the numbers, but wants the last 6 to be displayed, is there
an easy way to do this?

I understand this isn't technically a DB question as such, but if someone
could point me in the right direction (IE: which function to read up on) I
would really appreciate it.

Chris
 

Well, it can technically be done in either the query itself or PHP, I 
prefer to do that sort of thing in the query.

Using MySQL I woudl do somehting like:
CONCAT('xx',RIGHT(sColumn,6))
I didn't verify the RIGHT function ,but that sort of thing should be 
possible with any sort of DB server.

If I were doing it with PHP, it would be something like
$sColumn =  'xx'.substr($sColumn,-6);
Chris
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Can't compile Oracle's 10g support in PHP5

2005-05-13 Thread Christopher Jones
The --with-oracle option is a long deprecated interface to Oracle
and no-one has updated the configure script to work with Oracle 10g.
Can you use the new --with-oci8 option?  Otherwise you'll need to
update ext/oracle/config.m4.  The code in ext/oci8/config.m4 may help.
With either configure option, you need to specify the $ORACLE_HOME
directory, not $ORACLE_HOME/lib.
Chris
Mário Gamito wrote:
Hi,
I'm trying to compile PHP 5.04 with support to Oracle 10g, but i always
get the error:
checking Oracle version... configure: error: Oracle needed libraries
not found
Well, i think i have Oracle's libs in
/home/oracle/product/10.1.0/db_1/lib/
At least i have a lot of .so there.
How can i get overcome this problem ?
Any help would be apreciated.
My configure folloows my signature.
Warm Regards,
Mário Gamito
./configure --with-mysql=/usr/local/mysql --with-pgsql=/usr/local/pgsql
--with-openssl=/usr/local/ssl --enable-track-vars --with-xml
--with-mcrypt --with-gettext --with-ldap --enable-sockets --enable-wddx
--enable-xslt --with-xsltsablot --with-zlib --with-kerberos
--enable-bcmath --with-bz2 --enable-calendar --with-lpeg-dir
--with-tiff-dir --with-curl --with-curlwrappers --with-gdbm --with-expat
--with-iconv-dir --with-dom-xslt --with-dom-exslt --with-dom --with-db4
-with-flatfile --with-fam --enable-exif --with-gd --enable-ftp
--with-png-dir --with-xpm-dir --with-ttf --with-iconv --with-mhash
--with-ncurses --enable-soap --with-readline --with-pear
--with-oracle=/home/oracle/product/10.1.0/db_1/lib/
--with-apxs=/usr/local/httpd/bin/apxs --enable-sig-child
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] PEAR - My hosting company killed it

2005-05-13 Thread Dianne Mead
Hi,

I know this is the probably the wrong list for this question, but I'm a bit
desperate as my hosting company has disabled PEAR on the server, and I was
using it extensively on more than one website... suddenly my weekend looks
like a coding nightmare.  The hosting service reports a security issue, but
no details.   Has anyone using PEAR here run into this problem?  Is there
any potential resolution beyond recoding everything?  I'm looking at better
than ten sites to recode at this point, so other options would be greatly
appreciated.  The hosting company didn't give me any warning that this was
going to happen.

Thanks,
Dianne

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



[PHP-DB] novice on table design

2005-05-13 Thread tony yau

Hi all,

I have the following tables

EmployeeCustomernon-CustomerAddress
=======
pkey pkeypkey
pkey
number type type
...
payrate grantcapital

I need to allow the three types of people to have n addresses, so I've added
a type to distinguish the 3 types of people and their respective pkey onto
address table.

Address
=
pkey
...
type(either Employee, Customer or non-Customer etc)
fkey(the pkey of Employee, Customer or non-Customer etc)

I know this design looks awkward but it does have the advantage of having
less tables otherwise.
BUT somehow it doesn't feel right. Can someone points me its pros and cons.

thanks all.
Tony Yau

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



Re: [PHP-DB] PEAR - My hosting company killed it

2005-05-13 Thread Philip Hallstrom
I know this is the probably the wrong list for this question, but I'm a bit
desperate as my hosting company has disabled PEAR on the server, and I was
using it extensively on more than one website... suddenly my weekend looks
like a coding nightmare.  The hosting service reports a security issue, but
no details.   Has anyone using PEAR here run into this problem?  Is there
any potential resolution beyond recoding everything?  I'm looking at better
than ten sites to recode at this point, so other options would be greatly
appreciated.  The hosting company didn't give me any warning that this was
going to happen.
Haven't used pear much, but can't you just install the packages you need 
locally (ie. in your own web tree) and reference that for the time being?

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


Re: [PHP-DB] PEAR - My hosting company killed it. .

2005-05-13 Thread Patel, Aman
Dianne Mead wrote:
Hi,
I know this is the probably the wrong list for this question, but I'm a bit
desperate as my hosting company has disabled PEAR on the server, and I was
using it extensively on more than one website... suddenly my weekend looks
like a coding nightmare.  The hosting service reports a security issue, but
no details.   Has anyone using PEAR here run into this problem?  Is there
any potential resolution beyond recoding everything?  I'm looking at better
than ten sites to recode at this point, so other options would be greatly
appreciated.  The hosting company didn't give me any warning that this was
going to happen.
Thanks,
Dianne
I'd suggest tar/gz'ing your development server's PEAR directory (most 
likely /usr/share/pear if under *nix), and uploading that to somewhere 
in your production server's space (hopefully at non-web accessible 
location). You can than add that directory to your include_path (either 
through php.ini or .htaccess).

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


RE: [PHP-DB] novice on table design

2005-05-13 Thread Miguel Guirao
The schema of your table is wrong, is you do bnormalize it you will find out
that you need two tables for this approach.

One table for your people and another one for the n addresses of your
people.

If you keep your current schema, you will have as many rows for one person
as many addresses for that person you have, and you will be duplicating many
fields. So you must split your tables, one for your people and another for
your people's addresses.

-Original Message-
From: tony yau [mailto:[EMAIL PROTECTED]
Sent: Viernes, 13 de Mayo de 2005 09:27 a.m.
To: php-db@lists.php.net
Subject: [PHP-DB] novice on table design



Hi all,

I have the following tables

EmployeeCustomernon-CustomerAddress
=======
pkey pkeypkey
pkey
number type type
...
payrate grantcapital

I need to allow the three types of people to have n addresses, so I've added
a type to distinguish the 3 types of people and their respective pkey onto
address table.

Address
=
pkey
...
type(either Employee, Customer or non-Customer etc)
fkey(the pkey of Employee, Customer or non-Customer etc)

I know this design looks awkward but it does have the advantage of having
less tables otherwise.
BUT somehow it doesn't feel right. Can someone points me its pros and cons.

thanks all.
Tony Yau

--
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] novice on table design

2005-05-13 Thread tony yau
Hi Miguel,
Thanks for the reply.

the non-customer is actually a Shop, so Employee, Customer and Shop are
distinct enough to have their own tables. Now they all have an Address, and
the problem is how do I allow multiple addresses for each these 'people'
(without using
a lookup table)

tony.

Miguel Guirao [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 The schema of your table is wrong, is you do bnormalize it you will find
out
 that you need two tables for this approach.

 One table for your people and another one for the n addresses of your
 people.

 If you keep your current schema, you will have as many rows for one person
 as many addresses for that person you have, and you will be duplicating
many
 fields. So you must split your tables, one for your people and another for
 your people's addresses.

 -Original Message-
 From: tony yau [mailto:[EMAIL PROTECTED]
 Sent: Viernes, 13 de Mayo de 2005 09:27 a.m.
 To: php-db@lists.php.net
 Subject: [PHP-DB] novice on table design



 Hi all,

 I have the following tables

 EmployeeCustomernon-Customer
Address
 =======
 pkey pkeypkey
 pkey
 number type type
 ...
 payrate grantcapital

 I need to allow the three types of people to have n addresses, so I've
added
 a type to distinguish the 3 types of people and their respective pkey onto
 address table.

 Address
 =
 pkey
 ...
 type(either Employee, Customer or non-Customer etc)
 fkey(the pkey of Employee, Customer or non-Customer etc)

 I know this design looks awkward but it does have the advantage of having
 less tables otherwise.
 BUT somehow it doesn't feel right. Can someone points me its pros and
cons.

 thanks all.
 Tony Yau

 --
 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