Re: [PHP-DB] date function
1) Why do you send this to a DB list? 2) Try seeing the Date class of PEAR (PEAR::Date). El Dom 02 Nov 2003 19:13, OpenSource escribió: > Hi guys, > > This might not be the best place for this but here goes. > > I want to create a dropdown list with a date range of > -- > > Today > Yesterday > Fri 10/31 > Thu 10/30 > Wed 10/29 > Tue 10/28 > Mon 10/27 > Sun 10/26 > Sat 10/25 > Fri 10/24 > Thu 10/23 > Wed 10/22 > Tue 10/21 > Mon 10/20 > Sun 10/19 > Sun 10/12 > Sun 10/5 > Sun 9/28 > Sun 9/21 > Sun 9/14 > Sun 8/31 > Fri 8/1 > Wed 7/2 > Mon 6/2 > Sat 5/3 > Thu 4/3 > Tue 3/4 > Sun 2/2 > Fri 1/3 > Wed 12/4 > > -- > I would like to know i can go about doing that. some examples, or if anyone has a function already the i could use. > > > Thanks in advance, > > -- select 'mmarques' || '@' || 'unl.edu.ar' AS email; - Martín Marqués |[EMAIL PROTECTED] Programador, Administrador, DBA | Centro de Telemática Universidad Nacional del Litoral - -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] date function
have a look at the PEAR date package. http://pear.php.net/package/Date _ - Original Message - From: "OpenSource" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, November 02, 2003 11:13 PM Subject: [PHP-DB] date function Hi guys, This might not be the best place for this but here goes. I want to create a dropdown list with a date range of -- Today Yesterday Fri 10/31 Thu 10/30 Wed 10/29 Tue 10/28 Mon 10/27 Sun 10/26 Sat 10/25 Fri 10/24 Thu 10/23 Wed 10/22 Tue 10/21 Mon 10/20 Sun 10/19 Sun 10/12 Sun 10/5 Sun 9/28 Sun 9/21 Sun 9/14 Sun 8/31 Fri 8/1 Wed 7/2 Mon 6/2 Sat 5/3 Thu 4/3 Tue 3/4 Sun 2/2 Fri 1/3 Wed 12/4 -- I would like to know i can go about doing that. some examples, or if anyone has a function already the i could use. Thanks in advance, -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] date function
This might not be the best place for this but here goes. You are correct. At the very least, you should probably be using the general PHP list, not the database one. I want to create a dropdown list with a date range of Not to be obstinate, but it looks like you already have. But, assuming that you mean that you want to create this dynamically in PHP starting with today's date, then you need to establish some guidelines or rules for what dates make up the list. I can't really see a pattern in your list (every day for two weeks, then every week for five weeks, then two weeks once, then monthly going back a year) so I can't offer specifics. The answer will probably be found using a for loop and the date function. Larry -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] date function
Hi guys, This might not be the best place for this but here goes. I want to create a dropdown list with a date range of -- Today Yesterday Fri 10/31 Thu 10/30 Wed 10/29 Tue 10/28 Mon 10/27 Sun 10/26 Sat 10/25 Fri 10/24 Thu 10/23 Wed 10/22 Tue 10/21 Mon 10/20 Sun 10/19 Sun 10/12 Sun 10/5 Sun 9/28 Sun 9/21 Sun 9/14 Sun 8/31 Fri 8/1 Wed 7/2 Mon 6/2 Sat 5/3 Thu 4/3 Tue 3/4 Sun 2/2 Fri 1/3 Wed 12/4 -- I would like to know i can go about doing that. some examples, or if anyone has a function already the i could use. Thanks in advance,
Re: [PHP-DB] date function
On Saturday 06 September 2003 06:01, Darryl wrote: > I have some php code that pulls from the mysql database. Here it is: > > mysql_connect("wildcat.osborneindustries.com", "webuser", > "webpass"); >$mymonth = date('n'); >$cyear = date('Y'); > $query = "SELECT name,hdate FROM emp2 where month(hdate)=$mymonth > order by hdate"; > $result = mysql_db_query("iweb", $query); > > if ($result) { >echo ""; >while ($r = mysql_fetch_array($result)) { > $name = $r["name"]; > $hyear = date('Y',$r["hdate"]); > $timein = $cyear - $hyear; > if ($timein > 0) { > echo > "$name$timein$cyear$hyear";} >} >echo ""; > } else { > echo "No data."; > } > mysql_free_result($result); ?> > > I'm trying to figure out years of employment based on hiredate. Its not > working as expected. $timein is always > 1969. Date in the database is -MM-DD. What have I screwed up ? date() in php expects a unix timestamp. Dates in MySQL are NOT stored in unix timestamp format. You can perform the calculations directly in MySQL mysql manual > Tutorial Introduction > Date Calculations -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-db -- /* People with narrow minds usually have broad tongues. */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] date function
Greetings, I have some php code that pulls from the mysql database. Here it is: "; while ($r = mysql_fetch_array($result)) { $name = $r["name"]; $hyear = date('Y',$r["hdate"]); $timein = $cyear - $hyear; if ($timein > 0) { echo "$name$timein$cyear$hyear";} } echo ""; } else { echo "No data."; } mysql_free_result($result); ?> I'm trying to figure out years of employment based on hiredate. Its not working as expected. $timein is always 1969. Date in the database is -MM-DD. What have I screwed up ? thanks, Darryl -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Date function
Hi All, Is there any function in PHP4.X or in Oracle8i to calculate number of Business days ( excluding Saturday and Sunday) between two given dates? Thanks in advance. Sridhar. -Original Message- From: qartis [mailto:[EMAIL PROTECTED]] Sent: Monday, January 28, 2002 1:38 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [PHP-DB] Re: [PHP] File uploading like hotmail I think you might be looking for HTML form element. "Duky Yuen" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I want to make something like when you are attaching something to an > email in hotmail. I want to make something that searches your own > computer for files on your harddisk that you want to upload to the > server. > > But I don't know if this is possible. If this is possible.Can somebody > tell me which function I should use? Or if someone have an example... > please... > > Duky > -- 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 function.
Hi Sharif! try... $date1 = "2001-07-01"; $date2 = "2001-07-31"; $query = "SELECT * FROM table WHERE birthdays BETWEEN $date1 AND $date2"; regards Marcelo Gulin Sharif Islam escribió: > > This is a simple mysql question i am having problme with. > I have a table with name and birth date; > > > Joe | 1964-07-21 > Mary | 1978-05-22 > -- > I want to get the name with birthdays in the month of July. > thanks > > -- > 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 function.
select * from BIRTHDAYS where substr(Date,5,2) = '07'; -Original Message- From: Sharif Islam [mailto:[EMAIL PROTECTED]] Sent: Friday, January 19, 2001 11:56 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] Date function. This is a simple mysql question i am having problme with. I have a table with name and birth date; Joe | 1964-07-21 Mary | 1978-05-22 -- I want to get the name with birthdays in the month of July. thanks -- 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-DB] Date function.
This is a simple mysql question i am having problme with. I have a table with name and birth date; Joe | 1964-07-21 Mary | 1978-05-22 -- I want to get the name with birthdays in the month of July. thanks -- 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]