"Gerard Samuel" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> $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?
Sure - you need to have an extra space at the
end of each line... right now, it comes out like
... status_date, categoryFROM mpn_job ...
... mpn_job_category.IDAND category ...
I often find it useful to echo the query statement
just before using it... it makes mistakes like this
kind of obvious.
Also, if you used
$result = @mysql_query($query)
or die("Error querying: ".mysql_error());
you should get more-useful error messages.
--
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-mail: [EMAIL PROTECTED]