Re: Re: Exporting Data From MySQL Using PHP
| From: | Jason Wong | Date: | Tue, 10 Aug 2004 04:33:47 +0000 |
| Subject: | Re: Re: Exporting Data From MySQL Using PHP | ||
| References: | 1 2 3 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-35650@lists.php.net to get a copy of this message | ||
On Tuesday 10 August 2004 11:34, Peter Ellis wrote:
> It has been my experience that you sometimes need to do backquotes (`)
> in MySQL queries when cutting/pasting into PHP -- it's the same key as
> the tilde (~) on my keyboard. Try:
>
> $result = mysql_query("SELECT e_mail FROM subscriptionsdatabase WHERE
>
discipleship_mailing_list_e_mail_subscription LIKE
> 'on'");
The backticks (`) are only needed if:
(a) your column names uses (MySQL) reserved words (eg names of the builtin
functions etc)
(b) you have spaces in your column names
Both (a) and (b) are rather bad and shouldn't really be used. Just use
'friendly' column names and backticks will not be necessary.
> That should work. I've always used the equal sign instead of LIKE, but
> that seems to be a matter of preference.
It is not a matter of preference, = and LIKE have different purposes. Refer to
manual and/or some SQL tutorial for details.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
------------------------------------------
/*
Why won't you let me kiss you goodnight? Is it something I said?
-- Tom Ryan
*/