RE: [PHP-DB] Date help needed
Hi Neil, I would actually like to get a sample of this code as well if you don't mind K- -Original Message- From: Neil Smith [MVP, Digital media] [mailto:[EMAIL PROTECTED] Sent: 25 June 2004 16:22 To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Date help needed No, it's actually very easy to do the autocomplete once you get the hang of it. Actually the way I've done it is to populate a multi-select box but you could also use a DIV and write out the values Dump the email addresses as an XML file (generate this dynamically) then use XSLT to read out matching rows on each keyup ... basically you filter the XML file each time till you get down to one value Yes, it's javascript but it works really well as long as you have some control over your client browser (in the case of your boss, probably IE but it can be made to work in mozilla / firefox too) Mail me offlist if you want a working example. Cheers - Neil At 11:07 25/06/2004 +, you wrote: >Message-Id: <[EMAIL PROTECTED]> >From: "Chris Payne" <[EMAIL PROTECTED]> >To: <[EMAIL PROTECTED]> >Date: Thu, 24 Jun 2004 22:53:13 -0400 >MIME-Version: 1.0 >Content-Type: text/plain; > charset="us-ascii" >Content-Transfer-Encoding: 7bit >Subject: RE: [PHP-DB] Date help needed > >One thing he wanted which I didn't know how to do (Javascript I guess which >I don't know much about) was to preload a database of email address, and as >he started to type an email address it would do a sort of auto-complete, but >have no clue how to go about that so just told him not viable ATM. CaptionKit http://www.captionkit.com : Production tools for accessible subtitled internet media, transcripts and searchable video. Supports Real Player, Quicktime and Windows Media Player. VideoChat with friends online, get Freshly Toasted every day at http://www.fresh-toast.net : NetMeeting solutions for a connected world. -- 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] Date help needed
No, it's actually very easy to do the autocomplete once you get the hang of it. Actually the way I've done it is to populate a multi-select box but you could also use a DIV and write out the values Dump the email addresses as an XML file (generate this dynamically) then use XSLT to read out matching rows on each keyup ... basically you filter the XML file each time till you get down to one value Yes, it's javascript but it works really well as long as you have some control over your client browser (in the case of your boss, probably IE but it can be made to work in mozilla / firefox too) Mail me offlist if you want a working example. Cheers - Neil At 11:07 25/06/2004 +, you wrote: Message-Id: <[EMAIL PROTECTED]> From: "Chris Payne" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Date: Thu, 24 Jun 2004 22:53:13 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: RE: [PHP-DB] Date help needed One thing he wanted which I didn't know how to do (Javascript I guess which I don't know much about) was to preload a database of email address, and as he started to type an email address it would do a sort of auto-complete, but have no clue how to go about that so just told him not viable ATM. CaptionKit http://www.captionkit.com : Production tools for accessible subtitled internet media, transcripts and searchable video. Supports Real Player, Quicktime and Windows Media Player. VideoChat with friends online, get Freshly Toasted every day at http://www.fresh-toast.net : NetMeeting solutions for a connected world. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Date help needed
Hi there, >A drop down with 365 days !?!? Isn't that a "little" big? Actually it's Fridays, Sundays and Tuesdays for 2 years (365 was an example) it's for an Admin for a client, and he asked that it be in a dropdown box and he's the boss, so he gets what he wants :-) One thing he wanted which I didn't know how to do (Javascript I guess which I don't know much about) was to preload a database of email address, and as he started to type an email address it would do a sort of auto-complete, but have no clue how to go about that so just told him not viable ATM. Chris -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Date help needed
A drop down with 365 days !?!? Isn't that a "little" big? > I have a problem, I currently have some code which populates a dropdown > box > - this code gives me every day for the next x amount of days (EG: a years > worth of days), however what I really need to be able to do, is to find a > way to display this data in the dropdown box but ONLY show 3 days a week, > IE: Mondays, Fridays and Sundays, so it would show the dates for each > Monday, Friday and Sunday for X amount of days (IE: 365 days in the > dropdown). > > > > Does anyone have any idea how to do this? I would really appreciate any > help, I'd send my sample code only I'm not at my home/work computer ATM. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Date help needed
Hi there, Just got back and tried it and it works perfectly, thank you so much for your help, you've got me out of a bind here ;-) Chris You could loop through the weeks and put those 3 specifically in: $days = array(); for($i = 0; $i < 365; $i +=7) { $days[] = strtotime('next Monday', strtotime('+ '.$i.' days')); $days[] = strtotime('next Friday', strtotime('+ '.$i.' days')); $days[] = strtotime('next Sunday', strtotime('+ '.$i.' days')); } sort($days); foreach($days as $day) { echo date('Y-m-d', $day).''; } (This is not tested, but it *should* work,) On Thu, 24 Jun 2004 17:07:12 -0400, Chris Payne <[EMAIL PROTECTED]> wrote: > > Hi there everyone, > > I have a problem, I currently have some code which populates a dropdown box > - this code gives me every day for the next x amount of days (EG: a years > worth of days), however what I really need to be able to do, is to find a > way to display this data in the dropdown box but ONLY show 3 days a week, > IE: Mondays, Fridays and Sundays, so it would show the dates for each > Monday, Friday and Sunday for X amount of days (IE: 365 days in the > dropdown). > > Does anyone have any idea how to do this? I would really appreciate any > help, I'd send my sample code only I'm not at my home/work computer ATM. > > Chris > > !DSPAM:40db40cb34094233914063! > -- paperCrane --Justin Patrin-- -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Date help needed
You could loop through the weeks and put those 3 specifically in: $days = array(); for($i = 0; $i < 365; $i +=7) { $days[] = strtotime('next Monday', strtotime('+ '.$i.' days')); $days[] = strtotime('next Friday', strtotime('+ '.$i.' days')); $days[] = strtotime('next Sunday', strtotime('+ '.$i.' days')); } sort($days); foreach($days as $day) { echo date('Y-m-d', $day).''; } (This is not tested, but it *should* work,) On Thu, 24 Jun 2004 17:07:12 -0400, Chris Payne <[EMAIL PROTECTED]> wrote: > > Hi there everyone, > > I have a problem, I currently have some code which populates a dropdown box > - this code gives me every day for the next x amount of days (EG: a years > worth of days), however what I really need to be able to do, is to find a > way to display this data in the dropdown box but ONLY show 3 days a week, > IE: Mondays, Fridays and Sundays, so it would show the dates for each > Monday, Friday and Sunday for X amount of days (IE: 365 days in the > dropdown). > > Does anyone have any idea how to do this? I would really appreciate any > help, I'd send my sample code only I'm not at my home/work computer ATM. > > Chris > > !DSPAM:40db40cb34094233914063! > -- paperCrane --Justin Patrin-- -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Date help needed
Hi there everyone, I have a problem, I currently have some code which populates a dropdown box - this code gives me every day for the next x amount of days (EG: a years worth of days), however what I really need to be able to do, is to find a way to display this data in the dropdown box but ONLY show 3 days a week, IE: Mondays, Fridays and Sundays, so it would show the dates for each Monday, Friday and Sunday for X amount of days (IE: 365 days in the dropdown). Does anyone have any idea how to do this? I would really appreciate any help, I'd send my sample code only I'm not at my home/work computer ATM. Chris
Re: [PHP-DB] date help
Hello, You said that you are using MySQL. Create 2 columns like: create_ts INT UNSIGNED NOT NULL, last_login_ts INT UNSIGNED NOT NULL Use the MySQL UNIX_TIMESTAMP() function, comparable to the PHP time() function (number of seconds since 1-1-1970 12:00:00 AM). UPDATE table SET last_login_ts=UNIX_TIMESTAMP() where ID=12345; -Jason Garber IonZoft.com At 02:45 PM 11/17/2001 +, 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? > >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] -- 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
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] date help
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
I desperately need to know whether it is possible to call an Oracle function in PHP. For example... $functionResult=hubins($name,$commit_yn) where hubins is a stored procedure in our Oracle database. Can this be done? My first thought was to do something like this: $functionCall="hubins($name,$commit_yen)"; then then do ociexecute($functionCall); ...but that, of course didn't work. Any thoughts? -- 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] Date Help
--MS_Mac_OE_3066812333_145812_MIME_Part Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit When I want to subtract a day from a date, and pass the date to a function that will do the subtraction and then return the new value, so why does php sometimes subtract the year, instead of the day? I say sometimes, because I have other identical functions that work perfectly. Does php not pass the data type along with the variable? function subtract_a_day($datetoget) { $datetoget=($datetoget-1); return_date($datetoget); } --MS_Mac_OE_3066812333_145812_MIME_Part--