TJMAudio Posted May 29, 2008 Share Posted May 29, 2008 Say I have an INT row that contains numbers 0 through 11. If the user does not define a number, I want it to pull from the row, no matter what it contains. Sorry if I am explaining this unclearly. Anyways, would I just do it like this: SELECT * FROM table WHERE $variable LIKE '%' Or is there some other way of doing it? Quote Link to comment Share on other sites More sharing options...
blirette Posted May 30, 2008 Share Posted May 30, 2008 If your default value for the row is '' then you could say something like WHERE rowname >= 0 AND rowname <= 11 It should evade all other thing such as '' fields. Quote Link to comment Share on other sites More sharing options...
fenway Posted May 30, 2008 Share Posted May 30, 2008 You should be building your WHERE clause dynamically. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.