RE: [PHP-DB] A little JOIN help please...

2003-02-04 Thread Adam Royle
SELECT B.Title FROM phpCalendar_Details AS B, phpCalendar_Daily AS A
WHERE A.CalendarDetailsID = B.CalendarDetailsID AND CURDATE(  )  BETWEEN
A.StartDate AND A.StopDate





Also, you don't need to use the backticks around field names unless they contain 
spaces or other reserved words and characters.

Adam



RE: [PHP-DB] A little JOIN help please...

2003-02-04 Thread NIPP, SCOTT V (SBCSI)
Thanks...  I was able to figure it out using what my book calls the
old method.  Here is what ended up working for me:

SELECT B.Title FROM  `phpCalendar_Details`  AS B,  `phpCalendar_Daily`  AS A
WHERE A.CalendarDetailsID = B.CalendarDetailsID AND CURDATE(  )  BETWEEN
A.StartDate AND A.StopDate

-Original Message-
From: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 04, 2003 1:36 PM
To: NIPP, SCOTT V (SBCSI); [EMAIL PROTECTED]
Subject: Re: [PHP-DB] A little JOIN help please...


> SELECT 'A.Title'
> FROM `phpCalendar_Daily` AS 'B'
> JOIN 'phpCalendar_Details' AS 'A' ON 'A.CalendarDetailsID' =
> 'B.CalendarDetailsID'
> WHERE CURDATE( ) 
> BETWEEN 'B.StartDate' AND 'B.StopDate'

Take out all of those quotes! You're making strings out of everything.

WHERE CURDATE() BETWEEN 'string' AND 'anotherstring' etc...

---John Holmes...

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




Re: [PHP-DB] A little JOIN help please...

2003-02-04 Thread 1LT John W. Holmes
> SELECT 'A.Title'
> FROM `phpCalendar_Daily` AS 'B'
> JOIN 'phpCalendar_Details' AS 'A' ON 'A.CalendarDetailsID' =
> 'B.CalendarDetailsID'
> WHERE CURDATE( ) 
> BETWEEN 'B.StartDate' AND 'B.StopDate'

Take out all of those quotes! You're making strings out of everything.

WHERE CURDATE() BETWEEN 'string' AND 'anotherstring' etc...

---John Holmes...

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




[PHP-DB] A little JOIN help please...

2003-02-04 Thread NIPP, SCOTT V (SBCSI)
This is more of an SQL question, but I am not sure where else to
turn for help.  I am trying a JOIN, for the first time ever, and it is NOT
working for me.  The following is what I am attempting;

SELECT 'A.Title'
FROM `phpCalendar_Daily` AS 'B'
JOIN 'phpCalendar_Details' AS 'A' ON 'A.CalendarDetailsID' =
'B.CalendarDetailsID'
WHERE CURDATE( ) 
BETWEEN 'B.StartDate' AND 'B.StopDate'

This is simply in a SQL command window in phpMyAdmin, and it is
returning an error.  I have tried messing around with the quotes, and
everything else I can think of.  Someone please let me know what I am doing
wrong.  Thanks.

Scott Nipp
Phone:  (214) 858-1289
E-mail:  [EMAIL PROTECTED]
Web:  http:\\ldsa.sbcld.sbc.com



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