Forum Moderators: open

Message Too Old, No Replies

Force MySQL to return something instead of not returning a row?

When using SELECT if row !exists still need to return some value like null!

         

JAB Creations

10:50 pm on Nov 23, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I need MySQL to return something such as 'is_null' or really anything other then not returning a row to begin with when making a SELECT query. So if I make a query to SELET 26 items and only one item is found instead of returning only one row I still need it to return 26 rows even if 25 return 'is_null'.

- John

coopster

2:58 pm on Dec 1, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Sounds like you are joining tables. Use a LEFT JOIN rather than an INNER JOIN.
Example and explanation:
[webmasterworld.com...]