Re: MySQL SELECT help

From: Date: Fri, 10 Nov 2000 20:55:35 +0000
Subject: Re: MySQL SELECT help
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-24717@lists.php.net to get a copy of this message
Look up info on LEFT JOIN in the mysql manual. NOTE: You need AT LEAST two the the three though :O) --Joe On Fri, Nov 10, 2000 at 01:40:25PM +0800, Chris Lee wrote: > I have three tables > > table product > =========== > stockno > name > > table product_category > ================== > stockno > category > > table product_image > ================ > stockno > data > > select * from product > ================ > 1234 truck > > select * from product_category > ======================== > 1234 automobile > > select * from product_image > ====================== > 1234 file1.jpg > > select * from product, product_category, product_image > ============================================ > 1234 truck 1234 automobile 1234 file.jpg > > see thats fine, but now what I want is if there are no entries in one of > the tables to still return the data it knows about. ie. > > select * from product > ================ > 1234 truck > > select * from product_category > ======================== > 1234 automobile > > select * from product_image > ====================== > Empty Set > > select * from product, product_category, product_image > ============================================ > 1234 truck 1234 automobile NULL NULL > > > Can this be done ? > > Chris Lee > Mediawaveonline.com > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > -- > 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 ================================================================================ = Joe Stump joestump98@yahoo.com http://www.miester.org = ================================================================================ "Real programmers don't comment their code. It was hard to write, it should be hard to understand."

« previous php.general (#24717) next »