Re: MySQL joins
| From: | Richard Baskett | Date: | Mon, 25 Feb 2002 23:49:21 +0000 |
| Subject: | Re: MySQL joins | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-86173@lists.php.net to get a copy of this message | ||
Try this instead:
SELECT *, DATE_FORMAT(appointment.startdatetime, '%m-%d-%y') AS yrappt
FROM appointment
LEFT JOIN guest USING (appointment_id)
That should work, but I don¹t know what your table is like so I can only
guess all the required elements are there.
Rick
"Every person you meet - and everything you do in life - is an opportunity
to learn something." - Tom Clancy
> From: "Alexander P. Javier" <alyxj@yahoo.com>
> Date: Mon, 25 Feb 2002 15:40:47 -0800 (PST)
> To: php-general@lists.php.net
> Subject: [PHP] MySQL joins
>
>
> the query is:
>
> select appointment.*, date_format(appointment.startdatetime,'%m-%d-%Y') as
> yrappt from appointment left join guest on appointment.appointment_id =
> guest.appointment_id
>
>
> i think it's syntactically correct, it returns the correct rows when run with
> the mysql.exe program but gets an error when run thru my php code in a
> browser.
>
> by the way, i use apache-php-mysql for windows. and i program locally. please
> HEEEELLLLPPPP!!!! =(
>
>
> alyx
>
>
>
> ---------------------------------
> Do You Yahoo!?
> Yahoo! Sports - Coverage of the 2002 Olympic Games