Re: [PHP] Extracting from an Array

2002-06-14 Thread Andre Dubuc
[EMAIL PROTECTED] > > Cc: [EMAIL PROTECTED] > > Subject: Re: [PHP] Extracting from an Array > > > > Hi John, > > > > > /* Using PostgreSQL: it needs $numrows and $row=0 to work. Also set it > > to > > > choose only one record in db to simp

RE: [PHP] Extracting from an Array

2002-06-13 Thread John Holmes
> Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] Extracting from an Array > > Hi John, > > /* Using PostgreSQL: it needs $numrows and $row=0 to work. Also set it to > chooseonly one record in db to simplify testing. Date was set to 10 > May > 1998*/ > // $db conect st

Re: [PHP] Extracting from an Array

2002-06-12 Thread Andre Dubuc
lmes... > > > -Original Message- > > From: Andre Dubuc [mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, June 12, 2002 9:32 PM > > To: [EMAIL PROTECTED] > > Subject: Re: [PHP] Extracting from an Array > > > > Hi John, > > > > Yup. I

Re: [PHP] Extracting from an Array

2002-06-12 Thread Andre Dubuc
t;2". Do you realize what I'm trying to say?? > > ---John Holmes... > > > -Original Message- > > From: Andre Dubuc [mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, June 12, 2002 8:15 PM > > To: Lazor, Ed > > Cc: [EMAIL PROTECTED] > > Subje

RE: [PHP] Extracting from an Array

2002-06-12 Thread John Holmes
olmes... > -Original Message- > From: Andre Dubuc [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, June 12, 2002 8:15 PM > To: Lazor, Ed > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] Extracting from an Array > > Thanks Ed, > > Slight change -- I forgot that the de

RE: [PHP] Extracting from an Array

2002-06-12 Thread David Freeman
> I have a db field, type varchar, that is actually a 'date' > string formatted as dd-mm-. I used type 'varchar' (rather than > type 'date') since I had to accomplish other things with it. > Now, however, I do need to extract the Year (the last four > digits in the array). Ummm, are

RE: [PHP] Extracting from an Array

2002-06-12 Thread John Holmes
How about just SELECT RIGHT(fieldname,4) FROM tablename ---John Holmes... > -Original Message- > From: Lazor, Ed [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, June 12, 2002 7:09 PM > To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED] > Subject: RE: [PHP] Extracting f

Re: [PHP] Extracting from an Array

2002-06-12 Thread Andre Dubuc
Thanks Ed, Slight change -- I forgot that the delimiter was a 'space'. Anyway, I still get the first letter of the last part of the array. I guess what I need is something that specifies a range as in something like this: $Year = $Date[3-whatever?]; Seems rather odd that with the string as va

RE: [PHP] Extracting from an Array

2002-06-12 Thread Lazor, Ed
$sql = "select fieldname from tablename"; $Results = mysql_query($sql, $DBLink); $Row = mysql_fetch_array($Results); $fieldname = $Row["fieldname"]; $Date = explode("-", $fieldname); $Year = $Date[2]; > -Original Message- > From: Andre Dubuc [mailto:[EMAIL PROTECTED]] > Sent: Wednesday,