Re: double check query statement??
| From: | ERISEN, Mehmet Kamil | Date: | Tue, 28 Aug 2001 23:08:51 +0000 |
| Subject: | Re: double check query statement?? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-64910@lists.php.net to get a copy of this message | ||
Hi it may sound funny, but you may want to add a space at
the end of lines before ".
I mean
$query = "SELECT mpn_job.ID, job, assigned_to, status_date,
category ";
$query .= "FROM mpn_job, mpn_job_category WHERE CID =
mpn_job_category.ID ";
$query .= "AND category = '$category'";
also
echo $query;
before you run the php page to see the sql. I think your
$query is like
SELECT mpn_job.ID, job, assigned_to, status_date,
categoryFROM mpn_job, mpn_job_category WHERE CID =
mpn_job_category.IDND category
= '$category'
now, and it willl not run!
/mehmet/
--- Gerard Samuel <trini0@optonline.net> wrote:
> $query = "SELECT mpn_job.ID, job, assigned_to,
> status_date, category";
> $query .= "FROM mpn_job, mpn_job_category WHERE CID =
> mpn_job_category.ID";
> $query .= "AND category = '$category'";
> $result = mysql_query($query);
> $row = mysql_fetch_row($result);
> foreach ($row as $data) {
> echo "$data[0]";
> }
>
> I tried the SELECT statement from mysql command line
> (less $category, I
> used an actual category name) and it works there. I try
> it out in php,
> and I get nothing. (I echoed $category before this and
> it works
> correctly) Do you guys see anything in there that may
> need correcting?
> Thanks.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> php-general-unsubscribe@lists.php.net
> For additional commands, e-mail:
> php-general-help@lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin@lists.php.net
>
=====
Mehmet Erisen
http://www.erisen.com
__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/