Re: [PHP] SQL question

2010-01-27 Thread Skip Evans
Kim Madsen wrote: But Skip, as the others say, use a date class, since you're passing a php var on to the SQL anyway, then you could determine the exact days from start to end of donation. Combine this with to_days and you have your solution Yes, this sounds like the best way to go. Than

Re: [PHP] SQL question

2010-01-26 Thread Kim Madsen
Michael A. Peters wrote on 26/01/2010 06:04: I use seconds from epoch in the database simply because it works so well with the php date() function. If you need something where Julian day really is better, I assume it isn't that hard to convert between posix and julian day, though it seems od

Re: [PHP] SQL question

2010-01-26 Thread tedd
At 9:54 PM -0600 1/25/10, Skip Evans wrote: Hey all, I have an SQL query that's stumping me. I have two date variables, $start and $end that are in mm/dd/ format and two database fields, start_date and no_donations. The start date is mm/dd/ format and no_donations is an integer that

Re: [PHP] SQL question

2010-01-25 Thread Michael A. Peters
Michael A. Peters wrote: If you need something where Julian day really is better, I assume it isn't that hard to convert between posix and julian day, though it seems odd to me that it isn't part of the date() function. It probably should be. Looks like unixtojd() and jdtounix() do it. -

Re: [PHP] SQL question

2010-01-25 Thread Michael A. Peters
Paul M Foster wrote: Typically, coders try to store dates in unix timestamps internally, and then add 86400 seconds for every day to calculate intervals and such. This is often inaccurate. Julian days are far more accurate.) Paul I use seconds from epoch in the database simply because it wor

Re: [PHP] SQL question

2010-01-25 Thread Paul M Foster
On Mon, Jan 25, 2010 at 09:54:40PM -0600, Skip Evans wrote: > Hey all, > > I have an SQL query that's stumping me. > > I have two date variables, $start and $end that are in > mm/dd/ format and two database fields, start_date and > no_donations. The start date is mm/dd/ format and > no_don

[PHP] SQL question

2010-01-25 Thread Skip Evans
Hey all, I have an SQL query that's stumping me. I have two date variables, $start and $end that are in mm/dd/ format and two database fields, start_date and no_donations. The start date is mm/dd/ format and no_donations is an integer that represents the number of months from start_d

答复: [PHP] sql question

2005-04-07 Thread shimuqiheb
What do you want to do? for eg? Shi MuQi LangFang ABC (China) °v° Tel:(86)-316-68382!^ /(_)\ E-mail:[EMAIL PROTECTED] ^ ^ "William Stokes" <[EMAIL PROTECTED]> 写于 2005-04-08 01:23:39: > Hello, >

Re: [PHP] sql question

2005-04-07 Thread John Nichel
William Stokes wrote: Hello, This is not a php but sql question. My apologies but I don't know any good sql forums and I know that someone here might be able to answer. OK so the question is. How to make a SELECT query with WHERE definition that requires 2 conditions to be satisfied so that the

Re: [PHP] sql question

2005-04-07 Thread Philip Hallstrom
On Thu, 7 Apr 2005, William Stokes wrote: Hello, This is not a php but sql question. My apologies but I don't know any good sql forums and I know that someone here might be able to answer. OK so the question is. How to make a SELECT query with WHERE definition that requires 2 conditions to be satis

Re: [PHP] sql question

2005-04-07 Thread Joseph Connolly
if i understand you question... SELECT columns FROM table WHERE (condition #1) AND (condition #2); You can add many conditions. There are many ways to do this. This one is probably the most simple for only two conditions. Depending on your needs you also may need to create a subquery. SELECT col

[PHP] sql question

2005-04-07 Thread William Stokes
Hello, This is not a php but sql question. My apologies but I don't know any good sql forums and I know that someone here might be able to answer. OK so the question is. How to make a SELECT query with WHERE definition that requires 2 conditions to be satisfied so that the row gets selected? M

Re: [PHP] sql question

2003-06-04 Thread Marek Kilimajer
What about trying it first? Diana Castillo wrote: If I have a date in unix format in a numeric field in my table (Mysql) and I want to compare it to a date which is in unixformat also, will the query work like this? "SELECT from tarifs where unix_from_date<=".$dateinunixformat -- PHP General

[PHP] sql question

2003-06-04 Thread Diana Castillo
If I have a date in unix format in a numeric field in my table (Mysql) and I want to compare it to a date which is in unixformat also, will the query work like this? "SELECT from tarifs where unix_from_date<=".$dateinunixformat -- PHP General Mailing List (http://www.php.net/) To unsubscribe,

Re: [PHP] SQL Question: Search Records between two dates.

2002-12-10 Thread Ernest E Vogelsinger
select * from table_name where (start_date >='2002-10-01' and start_date <='2002-12-10') or (end_date >='2002-10-01' and end_date <='2002-12-10') At 01:08 11.12.2002, [-^-!-%- said: [snip] > >Hello everyone, > >I need to get a recordset between two dates, a

[PHP] SQL Question: Search Records between two dates.

2002-12-10 Thread [-^-!-%-
Hello everyone, I need to get a recordset between two dates, and am having a little trouble. I was wondering if someone could me make it more efficient. The goal: Each record has a start_date and end_date field. I want to be able to extract records that has the start_date and/or end_date, withi

[PHP] SQL question, getting error and not sure why

2002-05-30 Thread Michael Sweeney
My following query : insert into acteursenc (nuacteur,nomacteur) (select AA, BB from (select max(nuacteur)+1 AA from acteursenc), (select 'Michael Sweeney' BB from acteursenc))" produces an ORA-1: unique constraint error. The prima

RE: [PHP] SQL Question

2002-03-28 Thread Miguel Cruz
On Thu, 28 Mar 2002, Sebastian A. wrote: > When you say "ORDER BY that", is it also possible to do that via letters > such as ORDER BY 'S', because from what I understand, ORDER BY has to be > a column. The object of "order by" should be something that changes for each row, or else the statement

Re: [PHP] SQL Question

2002-03-28 Thread Jason Wong
On Friday 29 March 2002 00:30, Sebastian A. wrote: > When you say "ORDER BY that", is it also possible to do that via letters > such as ORDER BY 'S', because from what I understand, ORDER BY has to be a > column. In my example, 'this', 'that', 'the', & 'other' are all columns. So yes, ORDER BY x

RE: [PHP] SQL Question

2002-03-28 Thread Marcus Rasmussen
to:[EMAIL PROTECTED]] >Sent: Thursday, March 28, 2002 3:49 PM >To: [EMAIL PROTECTED] >Subject: Re: [PHP] SQL Question > >On Thursday 28 March 2002 22:34, Sebastian A. wrote: >> How do I sort out data from mysql_fetch_row() or mysql_fetch_array? For >> example say I wan

RE: [PHP] SQL Question

2002-03-28 Thread Rick Emery
To: [EMAIL PROTECTED] Subject: Re: [PHP] SQL Question On Thursday 28 March 2002 22:34, Sebastian A. wrote: > How do I sort out data from mysql_fetch_row() or mysql_fetch_array? For > example say I wanted to list all my users alphabetically. How would I do > this? Or say I had a form and

Re: [PHP] SQL Question

2002-03-28 Thread Jason Wong
On Thursday 28 March 2002 22:34, Sebastian A. wrote: > How do I sort out data from mysql_fetch_row() or mysql_fetch_array? For > example say I wanted to list all my users alphabetically. How would I do > this? Or say I had a form and I wanted to present the content to the user > *AFTER* they have

RE: [PHP] SQL Question

2002-03-28 Thread Rick Emery
/validate the data. Then, you'd write to the database. -Original Message- From: Sebastian A. [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 28, 2002 8:35 AM To: PHP General List (PHP.NET) Subject: [PHP] SQL Question How do I sort out data from mysql_fetch_row() or mysql_fetch_array? F

[PHP] SQL Question

2002-03-28 Thread Sebastian A.
How do I sort out data from mysql_fetch_row() or mysql_fetch_array? For example say I wanted to list all my users alphabetically. How would I do this? Or say I had a form and I wanted to present the content to the user *AFTER* they have filled it out so that they can check for mistakes. Mysql_fetc

RE: [PHP] sql question

2002-01-15 Thread Darren Gamble
3:04 PM To: Wolf-Dietrich von Loeffelholz; [EMAIL PROTECTED] Subject: Re: [PHP] sql question select * from tbl_lit where lit_source like "c%" Janet - Original Message - From: "Wolf-Dietrich von Loeffelholz" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent:

Re: [PHP] sql question

2002-01-15 Thread Janet Valade
select * from tbl_lit where lit_source like "c%" Janet - Original Message - From: "Wolf-Dietrich von Loeffelholz" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, January 15, 2002 12:09 PM Subject: [PHP] sql question i want that a select quer

RE: [PHP] sql question

2002-01-15 Thread Mehmet Kamil ERISEN
January 15, 2002 12:09 PM To: [EMAIL PROTECTED] Subject: [PHP] sql question i want that a select query display me all words beginning with an a .. like select * from tbl_lit where lit_source = 'c*' .. thnx bSue -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-m

RE: [PHP] sql question

2002-01-15 Thread Nathan Cassano
select * from tbl_lit where lit_source like 'c%'; Check out http://www.sqlcourse.com/ -Original Message- From: Wolf-Dietrich von Loeffelholz [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 15, 2002 12:09 PM To: [EMAIL PROTECTED] Subject: [PHP] sql question i want tha

[PHP] sql question

2002-01-15 Thread Wolf-Dietrich von Loeffelholz
i want that a select query display me all words beginning with an a .. like select * from tbl_lit where lit_source = ‘c*’ .. thnx bSue

[PHP] SQL question. how relevent are the search results ?

2001-11-16 Thread Chris Lee
if I give the user a search and he enters 'cat dog' I am going to want to find all the results that have the word 'cat' or 'dog' in them, but I want all the results that have 'cat' and 'dog' at the beginning of the results because these would be more relevent. now how I see it is this, it aint pre

Re: [PHP] SQL question

2001-01-31 Thread Daniel Grace
"John LYC" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > hi all, > > does mysql support this? > > select * from tablename where id in (select id from table2 where cond) > > thanks > No. MySQL does not support so-called sub-selects. Here's an easy workaround i

[PHP] SQL question

2001-01-30 Thread John LYC
hi all, does mysql support this? select * from tablename where id in (select id from table2 where cond) thanks -- PHP General 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