[PHP-DB] date function

2003-11-02 Thread OpenSource
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
--
SELECT name=bdate
 OPTION value=11/02/2003 SELECTEDToday
 OPTION value=11/01/2003Yesterday
 OPTION value=10/31/2003Fri 10/31
 OPTION value=10/30/2003Thu 10/30
 OPTION value=10/29/2003Wed 10/29
 OPTION value=10/28/2003Tue 10/28
 OPTION value=10/27/2003Mon 10/27
 OPTION value=10/26/2003Sun 10/26
 OPTION value=10/25/2003Sat 10/25
 OPTION value=10/24/2003Fri 10/24
 OPTION value=10/23/2003Thu 10/23
 OPTION value=10/22/2003Wed 10/22
 OPTION value=10/21/2003Tue 10/21
 OPTION value=10/20/2003Mon 10/20
 OPTION value=10/19/2003Sun 10/19
 OPTION value=10/12/2003Sun 10/12
 OPTION value=10/05/2003Sun 10/5
 OPTION value=09/28/2003Sun 9/28
 OPTION value=09/21/2003Sun 9/21
 OPTION value=09/14/2003Sun 9/14
 OPTION value=08/31/2003Sun 8/31
 OPTION value=08/01/2003Fri 8/1
 OPTION value=07/02/2003Wed 7/2
 OPTION value=06/02/2003Mon 6/2
 OPTION value=05/03/2003Sat 5/3
 OPTION value=04/03/2003Thu 4/3
 OPTION value=03/04/2003Tue 3/4
 OPTION value=02/02/2003Sun 2/2
 OPTION value=01/03/2003Fri 1/3
 OPTION value=12/04/2002Wed 12/4
/SELECT
--
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

2003-11-02 Thread Larry E . Ullman
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


Re: [PHP-DB] date function

2003-11-02 Thread Ignatius Reilly
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
--
SELECT name=bdate
 OPTION value=11/02/2003 SELECTEDToday
 OPTION value=11/01/2003Yesterday
 OPTION value=10/31/2003Fri 10/31
 OPTION value=10/30/2003Thu 10/30
 OPTION value=10/29/2003Wed 10/29
 OPTION value=10/28/2003Tue 10/28
 OPTION value=10/27/2003Mon 10/27
 OPTION value=10/26/2003Sun 10/26
 OPTION value=10/25/2003Sat 10/25
 OPTION value=10/24/2003Fri 10/24
 OPTION value=10/23/2003Thu 10/23
 OPTION value=10/22/2003Wed 10/22
 OPTION value=10/21/2003Tue 10/21
 OPTION value=10/20/2003Mon 10/20
 OPTION value=10/19/2003Sun 10/19
 OPTION value=10/12/2003Sun 10/12
 OPTION value=10/05/2003Sun 10/5
 OPTION value=09/28/2003Sun 9/28
 OPTION value=09/21/2003Sun 9/21
 OPTION value=09/14/2003Sun 9/14
 OPTION value=08/31/2003Sun 8/31
 OPTION value=08/01/2003Fri 8/1
 OPTION value=07/02/2003Wed 7/2
 OPTION value=06/02/2003Mon 6/2
 OPTION value=05/03/2003Sat 5/3
 OPTION value=04/03/2003Thu 4/3
 OPTION value=03/04/2003Tue 3/4
 OPTION value=02/02/2003Sun 2/2
 OPTION value=01/03/2003Fri 1/3
 OPTION value=12/04/2002Wed 12/4
/SELECT
--
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

2003-11-02 Thread Martin Marques
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
 --
 SELECT name=bdate
  OPTION value=11/02/2003 SELECTEDToday
  OPTION value=11/01/2003Yesterday
  OPTION value=10/31/2003Fri 10/31
  OPTION value=10/30/2003Thu 10/30
  OPTION value=10/29/2003Wed 10/29
  OPTION value=10/28/2003Tue 10/28
  OPTION value=10/27/2003Mon 10/27
  OPTION value=10/26/2003Sun 10/26
  OPTION value=10/25/2003Sat 10/25
  OPTION value=10/24/2003Fri 10/24
  OPTION value=10/23/2003Thu 10/23
  OPTION value=10/22/2003Wed 10/22
  OPTION value=10/21/2003Tue 10/21
  OPTION value=10/20/2003Mon 10/20
  OPTION value=10/19/2003Sun 10/19
  OPTION value=10/12/2003Sun 10/12
  OPTION value=10/05/2003Sun 10/5
  OPTION value=09/28/2003Sun 9/28
  OPTION value=09/21/2003Sun 9/21
  OPTION value=09/14/2003Sun 9/14
  OPTION value=08/31/2003Sun 8/31
  OPTION value=08/01/2003Fri 8/1
  OPTION value=07/02/2003Wed 7/2
  OPTION value=06/02/2003Mon 6/2
  OPTION value=05/03/2003Sat 5/3
  OPTION value=04/03/2003Thu 4/3
  OPTION value=03/04/2003Tue 3/4
  OPTION value=02/02/2003Sun 2/2
  OPTION value=01/03/2003Fri 1/3
  OPTION value=12/04/2002Wed 12/4
 /SELECT
 --
 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] ORACLE FUNCTION

2003-11-02 Thread Christopher Jones


MaNu wrote:

Function : 

FUNCTION PREZZO_TOT (
   pUtente in  v_utenti.utente%type,
   pTrasp  in  char
   ) return NUMBER;  

Php

$query = SELECT poe.carrello.prezzo_tot('AATCXNK2EN3RDKB','1') PIPPO FROM dual;
$parsed = ociparse($conn,$query);
ociexecute($parsed);
$numRows = ocifetchstatement($parsed, $result);
 
echo $numRows;   -- 1

echo $result[PIPPO][0];  --  NULL
MaNu,

There is nothing obviously wrong with your code.  After necessary
schema changes, it works fine for me with PHP 4.3.4RC2 against Oracle
9.2.
Calling var_dump($result) shows the return value is a string.  Is there a
PHP number conversion problem?  What value are you expecting returned?
Maybe you can use DBMS_OUTPUT to see what your PL/SQL function is
doing?  There is some PHP code to fetch DBMS_OUTPUT in a post to
Oracle's PHP forum, see:
 http://forums.oracle.com/forums/thread.jsp?forum=178thread=204531

Chris

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


[PHP-DB] HTML mail

2003-11-02 Thread Ronald Wiplinger
I got an interesting program to do:

For an MLM company I should make the news letter from the upline to the
direct downline (A sends emails to his NEXT DIRECT downline B1~ B12 emails)
To use a database with the from-line and the (three only) to-lines from 
the same data
base is easy. HOWEVER, they want me to send HTML emails (with their
products )

How can I send a HTML email via php?

bye

Ronald

--
Ronald Wiplinger  (CEO of ELMIT)
http://www.elmit.com+886 (0) 915 653-452
- I'm a SpamCon Foundation Member, #694, Verify it at http://www.spamcon.org
PS: Spam prevention!
Our system is protected with a spam prevention program. 
If you send us an e-mail, our system will send you a confirmation message back. Just reply to this confirmation message please. 
After receiving this confirmation message, our system will send the hold message (one) and all future messages (after the received confirmation message) to me without asking you again.

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


[PHP-DB] Date Pulldown

2003-11-02 Thread Peter Westergaard
Sorry for what is probably going to be a late reply.  I'm waiting to pick 
someone up at the airport, and the plane was delayed, so I wanted to try my 
hand at answering your question.

First I had to figure out what method you used to pick those dates in the 
first place.  It seems to be...

Today, Yesterday, then 1 day back for a total of 14 days (2 weeks)
Then going 1 week back for a total of 8 weeks (56 days)
Then I'm stumped how you came up with the jump from 9/14 to 8/31 to 
8/1 unless the rule is go back 2 weeks then go back 30 days...
Is there a reason the next rule can't be: go 1 month back for a total of 11 
months?

Here's a little piece of PHP code which will do just about exactly what 
you're looking for, with the rule modification I suggested.  Perhaps it 
will do the trick?  (And, since I'm no guru myself, I welcome comments on 
my suggestion).  It basically works around mktime and date.  Both are 
very good functions to accomplish what you're trying to accomplish.  Read 
up on those and you should be able to handle it.

form name=foo
select name=bdate
?php
	output_date_option ( mktime(0,0,0, date(m), date(d), date(Y)) , 
Today , SELECTED );
	output_date_option ( mktime(0,0,0, date(m), date(d)-1, date(Y)) , 
Yesterday );
	for ($days = 2; $days = 14; $days++) {
	output_date_option ( mktime(0,0,0, date(m), date(d)-$days, 
date(Y)) );
	}
	for ($weeks = 3; $weeks = 7; $weeks++) {
	output_date_option ( mktime(0,0,0, date(m), date(d)-($weeks*7), 
date(Y)) );
	}
	for ($months = 2; $months = 11; $months++) {
	output_date_option ( mktime(0,0,0, date(m)-$months, date(d), 
date(Y))  );
	}

function output_date_option($current_date, $date_string = , $xparams = ) {
	if (!isset($date_string) or $date_string == ) {
		$date_string = date ( D m/d , $current_date );
	}
	echo ( 'OPTION VALUE='.date ( m/d/Y , $current_date ).' 
'.$xparams.''.$date_string );
}
?
/select
/form

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


[PHP-DB] Re: HTML mail

2003-11-02 Thread Manuel Lemos
Hello,

On 11/02/2003 11:20 PM, Ronald Wiplinger wrote:
How can I send a HTML email via php?
Usually it is a matter of setting the right content-type header. 
However, you can't send plain HTML messages at the risk of having them 
discarded by anti-spam filters.

What you need to do is to compose a multipart/alternative message that 
contains both a plain text and and HTML alternative versions in the same 
body. The plain text part may just have a text saying that it is a HTML 
message, but it is necessary.

In that case, you may want to try this PHP class that makes it easy to 
compose and send HTML messages, including embedding images or 
attachments if necessary:

http://www.phpclasses.org/mimemessage

--

Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php