Re: [PHP-DB] Last Modified question..
Remember that the timestamp/default feature is only available to the 1st timestamp column in the table. This caught me a bit .. makes sense but if you don't know .. DSig On Fri, 31 Aug 2001 09:20:50 -0500, [EMAIL PROTECTED] (Rick Emery) wrote: > >You can use a TIMESTAMP field in the the record. When you INSERT a record, >set the field to NULL; the time will automatically be entered. The same is >true for files/records that are UPDATED. > >CREATE TABLE mytable ( >first_name varchar(25) default "", >last_name varchar(25) default "", >bday date, >timestamp timestamp >) > >$query = "INSERT INTO mytable VALUES ($first,$last,NULL)"; >mysql_query($query); > >$query = "UPDATE mytable SET bday=$birthday WHERE last_name=$$last && >first_name=$first"; >mysql_query($query); > >rick > > >-Original Message- >From: Jay Paulson [mailto:[EMAIL PROTECTED]] >Sent: Tuesday, August 28, 2001 5:04 PM >To: Justin Buist >Cc: PHP DB list (E-mail) >Subject: Re: [PHP-DB] Last Modified question.. > > >A) It's a MySQL database that I'm using >B) I'm using file_exsist() and to check the modified date I'm using >filemtime() >C) If I modify the permissions on the file wouldn't that possibly cause some >security issues? > >Thanks, >jay > >- Original Message - >From: "Justin Buist" <[EMAIL PROTECTED]> >To: "Jay Paulson" <[EMAIL PROTECTED]> >Cc: "PHP DB list (E-mail)" <[EMAIL PROTECTED]> >Sent: Tuesday, August 28, 2001 4:44 PM >Subject: Re: [PHP-DB] Last Modified question.. > > >> a) What kind of database is this? >> b) use fstat() to check the modification time on a specific file. >> c) You will have to modify permissions so that the user your web server >> runs as has 'read' permission on the file if you want to use fstat(). >> >> Justin Buist >> Trident Technology, Inc. >> 4700 60th St. SW, Suite 102 >> Grand Rapids, MI 49512 >> Ph. 616.554.2700 >> Fx. 616.554.3331 >> Mo. 616.291.2612 >> >> On Tue, 28 Aug 2001, Jay Paulson wrote: >> >> > I have a problem... I want to check the last modified time that a file >was >> > changed/updated. Actually, it's an employee database that I'm working >on >> > and I thought about just checking the last modified date on the file >that >> > the information was stored on. However, I get a permission denied error >and >> > I don't want to change the permissions of the file. Is there an easy >way to >> > check to see when the last time anyone logged in and updated their >> > 'employee' information? >> > >> > Thanks, >> > jay >> > >> > >> > -- >> > 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 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 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] Last Modified question..
You can use a TIMESTAMP field in the the record. When you INSERT a record, set the field to NULL; the time will automatically be entered. The same is true for files/records that are UPDATED. CREATE TABLE mytable ( first_name varchar(25) default "", last_name varchar(25) default "", bday date, timestamp timestamp ) $query = "INSERT INTO mytable VALUES ($first,$last,NULL)"; mysql_query($query); $query = "UPDATE mytable SET bday=$birthday WHERE last_name=$$last && first_name=$first"; mysql_query($query); rick -Original Message- From: Jay Paulson [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 28, 2001 5:04 PM To: Justin Buist Cc: PHP DB list (E-mail) Subject: Re: [PHP-DB] Last Modified question.. A) It's a MySQL database that I'm using B) I'm using file_exsist() and to check the modified date I'm using filemtime() C) If I modify the permissions on the file wouldn't that possibly cause some security issues? Thanks, jay - Original Message - From: "Justin Buist" <[EMAIL PROTECTED]> To: "Jay Paulson" <[EMAIL PROTECTED]> Cc: "PHP DB list (E-mail)" <[EMAIL PROTECTED]> Sent: Tuesday, August 28, 2001 4:44 PM Subject: Re: [PHP-DB] Last Modified question.. > a) What kind of database is this? > b) use fstat() to check the modification time on a specific file. > c) You will have to modify permissions so that the user your web server > runs as has 'read' permission on the file if you want to use fstat(). > > Justin Buist > Trident Technology, Inc. > 4700 60th St. SW, Suite 102 > Grand Rapids, MI 49512 > Ph. 616.554.2700 > Fx. 616.554.3331 > Mo. 616.291.2612 > > On Tue, 28 Aug 2001, Jay Paulson wrote: > > > I have a problem... I want to check the last modified time that a file was > > changed/updated. Actually, it's an employee database that I'm working on > > and I thought about just checking the last modified date on the file that > > the information was stored on. However, I get a permission denied error and > > I don't want to change the permissions of the file. Is there an easy way to > > check to see when the last time anyone logged in and updated their > > 'employee' information? > > > > Thanks, > > jay > > > > > > -- > > 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 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 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] Last Modified question..
A) It's a MySQL database that I'm using B) I'm using file_exsist() and to check the modified date I'm using filemtime() C) If I modify the permissions on the file wouldn't that possibly cause some security issues? Thanks, jay - Original Message - From: "Justin Buist" <[EMAIL PROTECTED]> To: "Jay Paulson" <[EMAIL PROTECTED]> Cc: "PHP DB list (E-mail)" <[EMAIL PROTECTED]> Sent: Tuesday, August 28, 2001 4:44 PM Subject: Re: [PHP-DB] Last Modified question.. > a) What kind of database is this? > b) use fstat() to check the modification time on a specific file. > c) You will have to modify permissions so that the user your web server > runs as has 'read' permission on the file if you want to use fstat(). > > Justin Buist > Trident Technology, Inc. > 4700 60th St. SW, Suite 102 > Grand Rapids, MI 49512 > Ph. 616.554.2700 > Fx. 616.554.3331 > Mo. 616.291.2612 > > On Tue, 28 Aug 2001, Jay Paulson wrote: > > > I have a problem... I want to check the last modified time that a file was > > changed/updated. Actually, it's an employee database that I'm working on > > and I thought about just checking the last modified date on the file that > > the information was stored on. However, I get a permission denied error and > > I don't want to change the permissions of the file. Is there an easy way to > > check to see when the last time anyone logged in and updated their > > 'employee' information? > > > > Thanks, > > jay > > > > > > -- > > 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 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] Last Modified question..
a) What kind of database is this? b) use fstat() to check the modification time on a specific file. c) You will have to modify permissions so that the user your web server runs as has 'read' permission on the file if you want to use fstat(). Justin Buist Trident Technology, Inc. 4700 60th St. SW, Suite 102 Grand Rapids, MI 49512 Ph. 616.554.2700 Fx. 616.554.3331 Mo. 616.291.2612 On Tue, 28 Aug 2001, Jay Paulson wrote: > I have a problem... I want to check the last modified time that a file was > changed/updated. Actually, it's an employee database that I'm working on > and I thought about just checking the last modified date on the file that > the information was stored on. However, I get a permission denied error and > I don't want to change the permissions of the file. Is there an easy way to > check to see when the last time anyone logged in and updated their > 'employee' information? > > Thanks, > jay > > > -- > 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 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]