You are here: Sub query generating errors in MySQL only « PHP SQL « IT news, forums, messages
Sub query generating errors in MySQL only

Posted by Seansan on 10/14/49 11:55

Hi there,

I have this query below and the SELECT COUNT statements are generating
errors in MySQL with php and I have no clue why. I would like to be
able to do this because this also works for other DB's. Any ideas?

Kind regards, Seansan

SELECT ttrss_feeds.*,
SUBSTRING(last_updated,1,19) AS last_updated_noms,
(SELECT COUNT(ttrss_entries.id) FROM ttrss_entries,
ttrss_user_entries
WHERE ttrss_user_entries.feed_id = ttrss_feeds.id AND
ttrss_user_entries.ref_id = ttrss_entries.id AND
owner_uid = 'admin') AS total,
(SELECT COUNT(ttrss_feeds.id) FROM ttrss_entries,ttrss_user_entries
WHERE feed_id = ttrss_feeds.id AND unread = 'true'
AND ttrss_user_entries.ref_id = ttrss_entries.id
AND owner_uid = 'admin') as unread,
cat_id,
last_error,
ttrss_feed_categories.title AS category,
ttrss_feed_categories.collapsed
FROM ttrss_feeds
LEFT JOIN ttrss_feed_categories ON (ttrss_feed_categories.id =
cat_id)
WHERE ttrss_feeds.owner_uid = 'admin' AND parent_feed IS NULL

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация