[PHP-DB] Social NetWork Db

2011-05-06 Thread Bruno Sandivilli
Hi , i want to model a simple db for user with a social network. Cold anyone help me? Thanks!

Re: [PHP-DB] COUNT and OUTER JOIN results

2011-05-06 Thread Ron Piggott
thank you for explaining this to me Amit. It works. Ron The Verse of the Day “Encouragement from God’s Word” http://www.TheVerseOfTheDay.info From: Amit Tandon Sent: Friday, May 06, 2011 5:49 AM To: Ron Piggott Cc: php-db@lists.php.net Subject: Re: [PHP-DB] COUNT and OUTER JOIN results D

Re: [PHP-DB] COUNT and OUTER JOIN results

2011-05-06 Thread Amit Tandon
Dear Ron Take your condition to ON cluause. So your on clause (for LEFT JOIN) would read something like ON `prayer_request_category`.` reference` = `prayer_requests`.`prayer_request_category_reference` AND `prayer_requests`.`approval_ level` IN ( 1, 3 ) `prayer_requests`.`prayer_request_type` =

[PHP-DB] COUNT and OUTER JOIN results

2011-05-06 Thread Ron Piggott
The following query returns all 8 prayer request categories with the total # of requests every submitted to each category: SELECT `prayer_request_category`.`reference` , `prayer_request_category`.`category` , COUNT( `prayer_requests`.`reference` ) AS category_request_count FROM `prayer_reques