[PHP-DB] Re: oci8 cannot connect after restarting DB

2004-11-18 Thread John Lim
Michael,

After rereading your post again, i realise you mentioned it's happening with 
non-persistent connections also. That puzzles me. Perhaps we are talking 
about multiple bugs here. In general, I have not found PHP5 and oci8 to be 
very stable, and would not recommend moving anything production to use PHP5 
just yet.

Regardsd, John

John Lim [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Hi

 This is because you are using persistent connections, which are
 left dangling and do not restart after the database restarts.
 Apparently you can hack your tnsnames.ora or oci8 extension.

 See http://bugs.php.net/bug.php?id=15390

 and http://bugs.php.net/bug.php?id=30808

 Regards, John

 Michael Caplan [EMAIL PROTECTED] wrote in message 
 news:[EMAIL PROTECTED]
 Every evening, for whatever reason, our Oracle db (9.2.0) is restated.
 After it is restarted, I am unable to build a connection with Oracle from
 PHP untill Apache is restarted.

 Whenever I do an ociplogon() or ocilogon() following an Oracle DB 
 restart,
 it fails but I am unable to get a description of the error.  Restarting
 Apache fixes the problem.

 Has anyone else experianced the same issue?  It appears to me that this 
 is a
 php oci8 bug.  (shouldn't a new connection be built if a persistant
 connection fails, and if not using persistant connections, shouldn't this 
 be
 a non issue?)

 Thanks,

 Michael

 

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



RE: [PHP-DB] Re: oci8 cannot connect after restarting DB

2004-11-18 Thread Michael Caplan
Hi John,

Just saw your blog today on Andi's PHP5 / Oracle article.  

One of the two bugs you sited in your previous email was one that I opened
(http://bugs.php.net/bug.php?id=30808)  I'm not sure what the case is with
the 4.3.x line, but my hunch this issue is 'bigger' than PHP5.  More
troubling is tony2001 response to my bug report (we don't want to turn on
the noted fix, but will implement something workable with PDO).  I'm anxious
to hear his reply to my follow-up: it makes no sense to me that oracle users
will have to settle for broken logon functions (with the fix sitting
commented in the current code) or abandond the oci8 library all together for
PDO when it hits the streets (which will be some time).

Best,

Michael


-Original Message-
From: John Lim [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 18, 2004 3:42 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Re: oci8 cannot connect after restarting DB


Michael,

After rereading your post again, i realise you mentioned it's happening with

non-persistent connections also. That puzzles me. Perhaps we are talking 
about multiple bugs here. In general, I have not found PHP5 and oci8 to be 
very stable, and would not recommend moving anything production to use PHP5 
just yet.

Regardsd, John

John Lim [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Hi

 This is because you are using persistent connections, which are left 
 dangling and do not restart after the database restarts. Apparently 
 you can hack your tnsnames.ora or oci8 extension.

 See http://bugs.php.net/bug.php?id=15390

 and http://bugs.php.net/bug.php?id=30808

 Regards, John

 Michael Caplan [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
 Every evening, for whatever reason, our Oracle db (9.2.0) is 
 restated. After it is restarted, I am unable to build a connection 
 with Oracle from PHP untill Apache is restarted.

 Whenever I do an ociplogon() or ocilogon() following an Oracle DB
 restart,
 it fails but I am unable to get a description of the error.  Restarting
 Apache fixes the problem.

 Has anyone else experianced the same issue?  It appears to me that 
 this
 is a
 php oci8 bug.  (shouldn't a new connection be built if a persistant
 connection fails, and if not using persistant connections, shouldn't this

 be
 a non issue?)

 Thanks,

 Michael

 

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




[PHP-DB] timestamp problem

2004-11-18 Thread Doug Parker
I'm trying to format a MySQL Timestamp Column Type with PHP, and it's not
going well.  In reading up on it, I see that the idea is to convert the
Timestamp type to Unix format using the strtotime() function, then using the
date() function to format that result.  However, this only appears to work
with MySQL versions above 4.1 - where the Timestamp has been modified to
have the : symbol in between the approprate numbers, as opposed to the
traditional extended format (i.e. 20041117104300), which can be found on
Mysql versions 4.0xx and below.  I have  MySQL 4.1 on my local machine, but
MySQL 4.0 something on the box I'm publishing to - which is obviously the
more important box.  So I need to get it working using the regular format.
And I don't want to just parse the characters because I have a bunch of
timestamp columns and don't really think it's that great of a resolution.

Any ideas?

thanks...

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



[PHP-DB] Re: timestamp problem

2004-11-18 Thread Sebastian Mendel
Doug Parker wrote:
I'm trying to format a MySQL Timestamp Column Type with PHP, and it's not
going well.  In reading up on it, I see that the idea is to convert the
Timestamp type to Unix format using the strtotime() function, then using the
date() function to format that result.  However, this only appears to work
with MySQL versions above 4.1 - where the Timestamp has been modified to
have the : symbol in between the approprate numbers, as opposed to the
traditional extended format (i.e. 20041117104300), which can be found on
Mysql versions 4.0xx and below.  I have  MySQL 4.1 on my local machine, but
MySQL 4.0 something on the box I'm publishing to - which is obviously the
more important box.  So I need to get it working using the regular format.
And I don't want to just parse the characters because I have a bunch of
timestamp columns and don't really think it's that great of a resolution.
SELECT UNIX_TIMESTAMP(`mysql_timestamp`)
or
SELECT DATE_FORMAT( ... )
--
Sebastian Mendel
www.sebastianmendel.de www.warzonez.de www.tekkno4u.de www.nofetish.com
www.sf.net/projects/phpdatetimewww.sf.net/projects/phptimesheet
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Problem compiling PHP 5 with MySQLi (64bit)

2004-11-18 Thread Sascha Noethen
Hi,
I am trying to compile PHP 5 with mysqli support:
./configure --with-mysqli
The result is an error message and I cannot find out how to avoid this 
error message:

checking for MySQLi support... yes
checking whether to enable embedded MySQLi support... no
checking for mysql_set_server_option in -lmysqlclient... no
configure: error: wrong mysql library version or lib not found. Check 
config.log for more information.

I am using PHP 5.0.2 and MySQL 4.1.7 for Intel EM64T.
Any hint what I can try?
Sascha
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: Problem compiling PHP 5 with MySQLi (64bit)

2004-11-18 Thread Sebastian Mendel
Sascha Noethen wrote:
Hi,
I am trying to compile PHP 5 with mysqli support:
./configure --with-mysqli
The result is an error message and I cannot find out how to avoid this 
error message:

checking for MySQLi support... yes
checking whether to enable embedded MySQLi support... no
checking for mysql_set_server_option in -lmysqlclient... no
configure: error: wrong mysql library version or lib not found. Check 
config.log for more information.

I am using PHP 5.0.2 and MySQL 4.1.7 for Intel EM64T.
Any hint what I can try?
MySQL-client installed ?
MySQL-shared installed ?
--
Sebastian Mendel
www.sebastianmendel.de www.warzonez.de www.tekkno4u.de www.nofetish.com
www.sf.net/projects/phpdatetimewww.sf.net/projects/phptimesheet
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] password encryption

2004-11-18 Thread Han
Hello,
I'm having a real problem and wondering if anyone can help.
I need to set up htaccess ans htpasswd files to authenticate users on my 
system.
I need to do it with PHP, but can't find a way of encrypting the password so 
it works.

I've used an online encrypter for testing the system, and I've got the 
.htaccess and .htpasswd files correct, but I need to programmatically 
encrypt the password in my script then write it to the 2 files.

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


RE: [PHP-DB] timestamp problem

2004-11-18 Thread Bastien Koert
this is a common mysql timestamp problem, you can try using 
DATE_FORMAT(datefield, FORMAT) sql function to define the date, or store the 
timestamp as a unix timestamp (an integer) from the get go

bastien
From: Doug Parker [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: [PHP-DB] timestamp problem
Date: Thu, 18 Nov 2004 10:46:53 -0800
I'm trying to format a MySQL Timestamp Column Type with PHP, and it's not
going well.  In reading up on it, I see that the idea is to convert the
Timestamp type to Unix format using the strtotime() function, then using 
the
date() function to format that result.  However, this only appears to work
with MySQL versions above 4.1 - where the Timestamp has been modified to
have the : symbol in between the approprate numbers, as opposed to the
traditional extended format (i.e. 20041117104300), which can be found on
Mysql versions 4.0xx and below.  I have  MySQL 4.1 on my local machine, 
but
MySQL 4.0 something on the box I'm publishing to - which is obviously the
more important box.  So I need to get it working using the regular format.
And I don't want to just parse the characters because I have a bunch of
timestamp columns and don't really think it's that great of a resolution.

Any ideas?
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] timestamp problem

2004-11-18 Thread Rodrigo Cabeceiras
Hi 
Does it help?



function time_stp(){
$curdate=getdate(time());
echo $curdate[weekday].  .$curdate[mday]. .$curdate[month].
.$curdate[year];
echo BR;
echo $curdate[hours].:.$curdate[minutes].:.$curdate[seconds];

}
function quiet_time_stp_data(){
$curdate=getdate(time());
$data_func=$curdate[year].- .$curdate[mon].- .$curdate[mday] ;
return $data_func;

}
function quiet_time_stp_hora(){
$curdate=getdate(time());
$hora_func =
$curdate[hours].:.$curdate[minutes].:.$curdate[seconds];
return $hora_func;

}

Rodrigo


---
Rodrigo Cabeceiras
-
Rua do Ameal nº 507 5º Esq
4200-061 Porto
-
Tel.:917776045
msn: [EMAIL PROTECTED]
-
web: www.rodrigocabeceiras.pt.to
 
-

-Mensagem original-
De: Doug Parker [mailto:[EMAIL PROTECTED] 
Enviada: quinta-feira, 18 de Novembro de 2004 18:47
Para: [EMAIL PROTECTED]
Assunto: [PHP-DB] timestamp problem

I'm trying to format a MySQL Timestamp Column Type with PHP, and it's not
going well.  In reading up on it, I see that the idea is to convert the
Timestamp type to Unix format using the strtotime() function, then using the
date() function to format that result.  However, this only appears to work
with MySQL versions above 4.1 - where the Timestamp has been modified to
have the : symbol in between the approprate numbers, as opposed to the
traditional extended format (i.e. 20041117104300), which can be found on
Mysql versions 4.0xx and below.  I have  MySQL 4.1 on my local machine, but
MySQL 4.0 something on the box I'm publishing to - which is obviously the
more important box.  So I need to get it working using the regular format.
And I don't want to just parse the characters because I have a bunch of
timestamp columns and don't really think it's that great of a resolution.

Any ideas?

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] password encryption

2004-11-18 Thread Gryffyn, Trevor
You can use PHP to handle the auth headers and all:

http://www.php.net/manual/en/features.http-auth.php


That might give you more flexibility than trying to dynamically set it
on the .htpassword and such.


There are a couple of ways to encrypt something.  You can do it in a way
that can be decrypted and checked against what the user entered.   Or
you can do a one-way encryption that uses the same method every time, so
someone enteres dog and it encrypts into sdlkfj..  If you do a
one-way encryption, there's no feasible way to turn sdlkfj back into
dog but if the user enters dog again, and you encrypt it the same
way, it'll always come out as sdlkfj which will match the one-way
encrypted string that you stored.

If you want to be cheesy, you can also use something like an MD5 has on
dog and get whatever it gets Then every time someone enters dog
it always ends up with the same MD5 hash.

The chance of two different strings having the same MD5 hash is very
very unlikely.

Anyway, some stuff to think about.  Good luck!

-TG

 -Original Message-
 From: Han [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, November 18, 2004 11:29 AM
 To: Bastien Koert; [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: [PHP-DB] password encryption
 
 
 Hello,
 
 I'm having a real problem and wondering if anyone can help.
 
 I need to set up htaccess ans htpasswd files to authenticate 
 users on my 
 system.
 I need to do it with PHP, but can't find a way of encrypting 
 the password so 
 it works.
 
 I've used an online encrypter for testing the system, and 
 I've got the 
 .htaccess and .htpasswd files correct, but I need to programmatically 
 encrypt the password in my script then write it to the 2 files.
 
 Han.
 
 -- 
 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] timestamp problem

2004-11-18 Thread John Holmes
Doug Parker wrote:
I'm trying to format a MySQL Timestamp Column Type with PHP, and it's not
going well.  In reading up on it, I see that the idea is to convert the
Timestamp type to Unix format using the strtotime() function, then using the
date() function to format that result.  However, this only appears to work
with MySQL versions above 4.1 - where the Timestamp has been modified to
have the : symbol in between the approprate numbers, as opposed to the
traditional extended format (i.e. 20041117104300), which can be found on
Mysql versions 4.0xx and below.  I have  MySQL 4.1 on my local machine, but
MySQL 4.0 something on the box I'm publishing to - which is obviously the
more important box.  So I need to get it working using the regular format.
And I don't want to just parse the characters because I have a bunch of
timestamp columns and don't really think it's that great of a resolution.
Use DATE_FORMAT() in your query to format the timestamp, TO_UNIXTIME() 
to retrieve a unix timestamp instead of a MySQL timestamp in your query, 
or use a couple substr() calls to pull out the pieces of the MySQL 
timestamp you need and then pass them to mktime().

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals  www.phparch.com
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP-DB] password encryption

2004-11-18 Thread peter
Quoting Gryffyn, Trevor [EMAIL PROTECTED]:

 If you want to be cheesy, you can also use something like an MD5 has on
 dog and get whatever it gets Then every time someone enters dog
 it always ends up with the same MD5 hash.

How is using MD5 cheesy?  I've implemented exactly that solution a number of
times.  Admittedly, only for a very small site, mainly as the 'site content
update' password.

-P

ps. and on another note, why am I in the list of direct addressees here?

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



Re: [PHP-DB] timestamp problem

2004-11-18 Thread Doug Parker
Ok, thanks for the input.  I knew that was an option as well, the problem is
that I have about eight different dates in the query, and I'd rather do a
query like SELECT projects.* FROM projects... and then format those
results, rather than do SELECT DATE_FORMAT('%m %d %Y', projects.Date1) AS
Date1, DATE_FORMAT('%m %d %Y', projects.Date2) AS Date2,... etc

any other suggestions?

John Holmes [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Doug Parker wrote:
  I'm trying to format a MySQL Timestamp Column Type with PHP, and it's
not
  going well.  In reading up on it, I see that the idea is to convert the
  Timestamp type to Unix format using the strtotime() function, then using
the
  date() function to format that result.  However, this only appears to
work
  with MySQL versions above 4.1 - where the Timestamp has been modified to
  have the : symbol in between the approprate numbers, as opposed to the
  traditional extended format (i.e. 20041117104300), which can be found on
  Mysql versions 4.0xx and below.  I have  MySQL 4.1 on my local machine,
but
  MySQL 4.0 something on the box I'm publishing to - which is obviously
the
  more important box.  So I need to get it working using the regular
format.
  And I don't want to just parse the characters because I have a bunch of
  timestamp columns and don't really think it's that great of a
resolution.

 Use DATE_FORMAT() in your query to format the timestamp, TO_UNIXTIME()
 to retrieve a unix timestamp instead of a MySQL timestamp in your query,
 or use a couple substr() calls to pull out the pieces of the MySQL
 timestamp you need and then pass them to mktime().

 --

 ---John Holmes...

 Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

 php|architect: The Magazine for PHP Professionals – www.phparch.com

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



RE: [PHP-DB] password encryption

2004-11-18 Thread Gryffyn, Trevor
Hah.. Because I figured it wouldn't be an accepted solution by real
security people. :)  I've used it too.  Also used the md5_file()
function to create a duplicate file scanner for my home PC.

The only problem with using MD5 or another one-way solution on a general
site that doesn't require super-security is that when people forget
their password, you have to do a Click this to reset your password,
have it reset to something random, then have them change it when they
log in.  There's no Send me my password ability, which I find kind of
useful on general sites that make you log in (free registration and
such).

As for why you're in the direct mail.. I don't know.  I just did Reply
all to the original question and you must have been in it. :)

Just enjoy the love and stop complaining. Hah.

-TG

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, November 18, 2004 12:15 PM
 To: [EMAIL PROTECTED]
 Subject: RE: [PHP-DB] password encryption
 
 
 Quoting Gryffyn, Trevor [EMAIL PROTECTED]:
 
  If you want to be cheesy, you can also use something like 
 an MD5 has on
  dog and get whatever it gets Then every time someone 
 enters dog
  it always ends up with the same MD5 hash.
 
 How is using MD5 cheesy?  I've implemented exactly that 
 solution a number of times.  Admittedly, only for a very
 small site, mainly as the 'site content update' password.
 
 -P
 
 ps. and on another note, why am I in the list of direct 
 addressees here?

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



[PHP-DB] I'm less experienced please be gentle :)

2004-11-18 Thread ed
Can anyone tell me whats wrong with the below code? it doesnt execute.

$ip=$_SERVER[REMOTE_ADDR]; 

$banned=SELECT * FROM banned WHERE ip='$ip'; 

if(@mysql_num_rows(mysql_query($banned))  0) { 

echo You have been Banned.; 

}else{ 
echo $ip; 
} 


Re: RE: [PHP-DB] Re: oci8 cannot connect after restarting DB

2004-11-18 Thread CHRISTOPHER . JONES
During my presentation at the PHP Conference in Frankfurt I put
out a call for participation in creating a roadmap for Oracle 
connectivity in PHP.

When I get back to work (I'm on a short vacation in Europe with 
intermittent email access) I'll be following up on this.  While I'm
away, feel free to fill my inbox with suggestions and discussion
of your application architecture requirements.

Chris

PS The Zend guys have kindly offered to look at the commonly
reported Windows/PHP5.0.2/OCI8 crash.  Or if anyone is compiling
this combo maybe they can contribute???---BeginMessage---
Hi John,

Just saw your blog today on Andi's PHP5 / Oracle article.  

One of the two bugs you sited in your previous email was one that I opened
(http://bugs.php.net/bug.php?id=30808)  I'm not sure what the case is with
the 4.3.x line, but my hunch this issue is 'bigger' than PHP5.  More
troubling is tony2001 response to my bug report (we don't want to turn on
the noted fix, but will implement something workable with PDO).  I'm anxious
to hear his reply to my follow-up: it makes no sense to me that oracle users
will have to settle for broken logon functions (with the fix sitting
commented in the current code) or abandond the oci8 library all together for
PDO when it hits the streets (which will be some time).

Best,

Michael


-Original Message-
From: John Lim [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 18, 2004 3:42 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Re: oci8 cannot connect after restarting DB


Michael,

After rereading your post again, i realise you mentioned it's happening with

non-persistent connections also. That puzzles me. Perhaps we are talking 
about multiple bugs here. In general, I have not found PHP5 and oci8 to be 
very stable, and would not recommend moving anything production to use PHP5 
just yet.

Regardsd, John

John Lim [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Hi

 This is because you are using persistent connections, which are left 
 dangling and do not restart after the database restarts. Apparently 
 you can hack your tnsnames.ora or oci8 extension.

 See http://bugs.php.net/bug.php?id=15390

 and http://bugs.php.net/bug.php?id=30808

 Regards, John

 Michael Caplan [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
 Every evening, for whatever reason, our Oracle db (9.2.0) is 
 restated. After it is restarted, I am unable to build a connection 
 with Oracle from PHP untill Apache is restarted.

 Whenever I do an ociplogon() or ocilogon() following an Oracle DB
 restart,
 it fails but I am unable to get a description of the error.  Restarting
 Apache fixes the problem.

 Has anyone else experianced the same issue?  It appears to me that 
 this
 is a
 php oci8 bug.  (shouldn't a new connection be built if a persistant
 connection fails, and if not using persistant connections, shouldn't this

 be
 a non issue?)

 Thanks,

 Michael

 

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


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

Re: [PHP-DB] I'm less experienced please be gentle :)

2004-11-18 Thread Micah Stevens

What does it do? Does it give a specific error? I don't see anything wrong 
with it. If it's not giving an error, perhaps it's returning unexpected 
results? 

This change may give you some insight: 

change: 
if(@mysql_num_rows(mysql_query($banned))  0) {

to:

$result = mysql_query($banned) or die (mysql_error());
if (mysql_num_rows($result)  0) {

--- 

This will give you some mysql errors if that's where the problem lies. 
HTH
-Micah 

On Thursday 18 November 2004 11:14 am, [EMAIL PROTECTED] wrote:
 Can anyone tell me whats wrong with the below code? it doesnt execute.

 $ip=$_SERVER[REMOTE_ADDR];

 $banned=SELECT * FROM banned WHERE ip='$ip';

 if(@mysql_num_rows(mysql_query($banned))  0) {

 echo You have been Banned.;

 }else{
 echo $ip;
 }

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



RE: [PHP-DB] I'm less experienced please be gentle :)

2004-11-18 Thread Norland, Martin
Remove the @ in front of the mysql_num_rows function call.  The @ symbol
supresses errors, so that's likely where your error would be printed.

Cheers
- Martin Norland, Database / Web Developer, International Outreach x3257
The opinion(s) contained within this email do not necessarily represent
those of St. Jude Children's Research Hospital.


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 18, 2004 1:15 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] I'm less experienced please be gentle :)


Can anyone tell me whats wrong with the below code? it doesnt execute.

$ip=$_SERVER[REMOTE_ADDR]; 

$banned=SELECT * FROM banned WHERE ip='$ip'; 

if(@mysql_num_rows(mysql_query($banned))  0) { 

echo You have been Banned.; 

}else{ 
echo $ip; 
} 

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



RE: [PHP-DB] Re: oci8 cannot connect after restarting DB

2004-11-18 Thread Andreas Karajannis
On Thu, 2004-11-18 at 11:41 -0700, [EMAIL PROTECTED] wrote:
 During my presentation at the PHP Conference in Frankfurt I put
 out a call for participation in creating a roadmap for Oracle 
 connectivity in PHP.
 
 When I get back to work (I'm on a short vacation in Europe with 
 intermittent email access) I'll be following up on this.  While I'm
 away, feel free to fill my inbox with suggestions and discussion
 of your application architecture requirements.

I've been recently looking into the OCI8 extension.
Alas, with PHP5 and multithreaded web servers (Apache2 et.al.), the
connection handling seems to be completly broken.

Using PHP5 and the current oci8 module in an mt environment leads to
sessions stacking up on a single server connection without getting
closed nor reused. I didn't try the classic multi process environment,
but I suspect the same broken behaviour to show up.

So what you get right now is a non working session multiplexing (ala
Oracle MTS) which surely is not what people want when the need
connection pooling.

Another area where PHP Oracle support needs improvement is national
charset support. Currently NCLOBs simply don't work. 

Additionaly, the LOB handling support is more complex (using implicit
LOB descriptors) than it need to be, taking into consideration the LOB
handling capabilities introduced with OCI 9.2.

Using the new thread safe hash lists of PHP5, I've successfully
implemented (let's say proof of concept quality ;-)) an extension based
on the current OCI8 code that can use native OCI session pooling
(instead of implementing own connection pooling code) and is able to
handle national character data while mostly retaining backwards
compatability - normal connects are still possible besides predefinded
pools.

So what to do?

While I see great potential in PDO, having a common API as in JDBC or
ODBC would be great, it seems there isn't much development going in that
direction. 
Additionaly, every application would need a major rewrite to switch from
the current oci8 extension to something different.

So, building on the existing OCI8 extension and improving it in the
afore mentioned areas seems to a pragmatic approach while retaining PHP
API compatability for people already using Oracle with PHP.

This would mean dropping support for client libraries before Oracle 9.2,
making it possible to throw away much of the convoluted legacy stuff in
the connection / LOB handling code.
Remember, with OCI client 9.2, you can still connect to 8.1 databases.
If there is still demand for connecting to pre 8.1 databases, people
would have to stick with PHP4, which seems to me reasonable.

Any comments are welcome to better support the greatest RDBMS with
PHP ;-)

 -Andreas
-- 
Andreas Karajannis
mediaworx berlin AG

Fon (030) 2 75 80 - 266
Fax (030) 2 75 80 - 200

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



[PHP-DB] Frames mySQL

2004-11-18 Thread Ron Piggott
I have another challenge I am trying to over come.  Frames.

I have my screen set up in 3 frames.  2 for user input and the third is for
data --- letting the user know what has just happened.  IE RECORD UPDATED
is what I want to be displayed there.  The catch is this --- how do I
display text in the data frame.  Any idea?  I know the a
href=next_screen.html TARGET=dataSUBMIT/a command ... But I am
wanting to write to the database with a form and then have the same form
come up again to be filled out again and the data window let the user know a
message such as RECORD RECEIVED.  Can a PHP script do this?

Ron

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



Re: [PHP-DB] Frames mySQL

2004-11-18 Thread Ramil Sagum
On Thu, 18 Nov 2004 21:16:51 -0500, Ron Piggott
[EMAIL PROTECTED] wrote:
 I have another challenge I am trying to over come.  Frames.
 
 I have my screen set up in 3 frames.  2 for user input and the third is for
 data --- letting the user know what has just happened.  IE RECORD UPDATED
 is what I want to be displayed there.  The catch is this --- how do I
 display text in the data frame.  Any idea?  I know the a
 href=next_screen.html TARGET=dataSUBMIT/a command ... But I am
 wanting to write to the database with a form and then have the same form
 come up again to be filled out again and the data window let the user know a
 message such as RECORD RECEIVED.  Can a PHP script do this?
 

Hi Ron,

You don't need to submit to the data frame. Just submit the form to
the same frame, then call a reload on the other frame using
javascript.





ramil

http://ramil.sagum.net

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



Re: [PHP-DB] Frames mySQL

2004-11-18 Thread Micah Stevens

I would use Javascript to update the page content. You can use the DOM to 
access the content in other frames as long as it's the same base URL I think. 
So when you output the form after storing the record, output a script that 
changes the bottom frame.

Look up javascript InnerHTML in google.. that should give you some ideas

On Thursday 18 November 2004 06:16 pm, Ron Piggott wrote:
 I have another challenge I am trying to over come.  Frames.

 I have my screen set up in 3 frames.  2 for user input and the third is for
 data --- letting the user know what has just happened.  IE RECORD UPDATED
 is what I want to be displayed there.  The catch is this --- how do I
 display text in the data frame.  Any idea?  I know the a
 href=next_screen.html TARGET=dataSUBMIT/a command ... But I am
 wanting to write to the database with a form and then have the same form
 come up again to be filled out again and the data window let the user know
 a message such as RECORD RECEIVED.  Can a PHP script do this?

 Ron

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



[PHP-DB] Firebird and PHP

2004-11-18 Thread Mario Lacunza
Hello,
Is possible work with Firebird ? and how?
Thanks and advance!!
Mario Lacunza
Lima-Peru
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php