[PHP-DB] date help

2001-11-17 Thread Srinivasan Ranganathan

Hi

I need to store the date and time of sign-up and date
and time of last successful login in a mysql database
and calculate how long the user has been using a site.
how do i do this?

thanks in advance
Srinivasan

__
Do You Yahoo!?
Everything you'll ever need on one web page from News and Sport to Email and Music 
Charts
http://uk.my.yahoo.com

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] date help

2001-11-17 Thread Andreas D. Landmark

At 17.11.2001 14:45, Srinivasan Ranganathan wrote:
Hi

I need to store the date and time of sign-up and date
and time of last successful login in a mysql database
and calculate how long the user has been using a site.
how do i do this?

Store date either in seconds since 19700101 or use your
rdbms' datefield (most of them've got one).

(I always prefer seconds as it's IMHO the easier to do calculations
with)


-- 
Andreas D Landmark / noXtension
Real Time, adj.:
 Here and now, as opposed to fake time, which only occurs there
and then.


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] find a value by array key

2001-11-17 Thread olinux

$fullmenu[$parent][$id]  -- I have this array - 

what is the quickest way that i can call the index
that is $fullmenu[$parent][15] 

in other words use a wildcard for the $parent variable
and specify the second key - i know that I could do a
double foreach thru them but is there a way to just
grab that value since there will only be one?

thanks,
olinux

__
Do You Yahoo!?
Find the one for you at Yahoo! Personals
http://personals.yahoo.com

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] PHP/Apache not totally closing MySQL connections

2001-11-17 Thread Bob Maple

I've been through the bug database a couple of times, and scanned through
the list archives before joining, but haven't exactly found anything that
matches what is happening in my case.

First, dirty details: I am running MySQL 3.23.33, Apache 1.3.19, and PHP
4.0.6 under an RH system on kernel 2.2.19.  PHP running as a module in
Apache.

I am having a little quirk with persistant connections with MySQL.  The
connections themselves work;  However, after a while when the connections
time out, they don't seem to be closing all the way.  For instance, right
now if I do a netstat, among some other connections I get:

Proto Recv-Q Send-Q Local Address
tcp1  0 burner.com:4848 burner.com:mysqlCLOSE

This has been there and been in CLOSE state all day.  It was there
yesterday. It will be there tomorrow.  MySQL has terminated the connection
as far as it cares (if I mysqladmin processlist, no connections show up.)
Indeed, if I shut down the MySQL server, the socket remains.  Only if I shut
down Apache will it ever go away.

So, if left going for awhile, tons of these dead sockets will pile up.

Before I post a bug report, anyone have any ideas?


 :  Bob Maple  (Brazilian)  : When love is gone, there's always justice.  :
 :  bobm at burner dot com  : And when justice is gone, there's always:
 :  : force.  And when force is gone, there's :
 : http: burner.com : always Mom.  Hi, Mom! - Laurie Anderson :



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] PHP/Apache not totally closing MySQL connections

2001-11-17 Thread Andreas D. Landmark

At 18.11.2001 02:06, Bob Maple wrote:
I've been through the bug database a couple of times, and scanned through
the list archives before joining, but haven't exactly found anything that
matches what is happening in my case.

First, dirty details: I am running MySQL 3.23.33, Apache 1.3.19, and PHP
4.0.6 under an RH system on kernel 2.2.19.  PHP running as a module in
Apache.

Good, pretty complete details.

I am having a little quirk with persistant connections with MySQL.  The
connections themselves work;  However, after a while when the connections
time out, they don't seem to be closing all the way.  For instance, right
now if I do a netstat, among some other connections I get:

Proto Recv-Q Send-Q Local Address
tcp1  0 burner.com:4848 burner.com:mysqlCLOSE

[munge-alert!]

This is strange as the normal output from netstat should look like this
Proto Recv-Q Send-Q Local Address   Foreign Address State
tcp0  0 localhost:46764 localhost:imap4sESTABLISHED
tcp0  0 localhost:imap4slocalhost:46764 ESTABLISHED

Yours seem to miss out at least to headings, who knows what else is missing?

and there is no such state as CLOSE, so I'll assume for the rest of the email
that you're refering to CLOSED.


This has been there and been in CLOSE state all day.  It was there
yesterday. It will be there tomorrow.  MySQL has terminated the connection
as far as it cares (if I mysqladmin processlist, no connections show up.)
Indeed, if I shut down the MySQL server, the socket remains.  Only if I shut
down Apache will it ever go away.

So, if left going for awhile, tons of these dead sockets will pile up.

nope, if you leave it going for awhile nothing out of the ordinary happens,
the socket will be reused (when it's time is up).

the reason it doesn't go away until Apache is closed is that this is apache's
socket, and not MySQL's, as the forreign address is the :mysql.

Before I post a bug report, anyone have any ideas?

Yes, read netstat(8).

and I quote:
CLOSED The socket is not being used.

if the socket was dead you'd either see
CLOSE_WAIT
   The remote end  has  shut  down,  waiting  for  the
   socket to close.

LAST_ACK
   The  remote  end  has  shut down, and the socket is
   closed. Waiting for acknowledgement.

(or even a time_wait, but only for a limited time, unless you've got some
nifty problems with loopback.)

What is the problem here really?
MySQL isn't chewing resources, Apache isn't chewing resources, the fact of
the matter is that you're seeing closed sockets, sockets that will be 
reused when
apache+php reconnects to MySQL.

The only intriguing part about your post is that the Recv-Q is still 1, but 
all in all
I wouldn't worry...


-- 
Andreas D Landmark / noXtension
Real Time, adj.:
 Here and now, as opposed to fake time, which only occurs there
and then.


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] PHP/Apache not totally closing MySQL connections

2001-11-17 Thread Bob Maple

 Proto Recv-Q Send-Q Local Address
 tcp1  0 burner.com:4848 burner.com:mysqlCLOSE

 [munge-alert!]

Hmm, looks like my pastes got whacked.  Oops.

 nope, if you leave it going for awhile nothing out of the ordinary
happens,
 the socket will be reused (when it's time is up).

 the reason it doesn't go away until Apache is closed is that this is
apache's
 socket, and not MySQL's, as the forreign address is the :mysql.

OK, thanks -- I did some rapid refreshes of a page and indeed, the 'CLOSED'
state sockets ultimately are being recycled.  I guess I just wasn't getting
the same httpd process that had them open before, because at one point I had
about 5 of these sockets hanging around while new connections continued to
appear.


 :  Bob Maple  (Brazilian)  : When love is gone, there's always justice.  :
 :  bobm at burner dot com  : And when justice is gone, there's always:
 :  : force.  And when force is gone, there's :
 : http: burner.com : always Mom.  Hi, Mom! - Laurie Anderson :



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] ODBC

2001-11-17 Thread alfareees alfareees

how can I take the first 5 records from access xp
by odbc or PHP ?

_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] ODBC

2001-11-17 Thread alfareees alfareees

how can I take the first 5 records from access xp
by odbc or PHP ?

_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]