(PHP) Checking if a field is empty in a database query call and output data if it isn't -


i'm putting database query search engine can specify whether row should have imagestring or not in result. in database field empty if there no image, or have random image name (e.g. 1238791.jpg). when construct query string check every field , add onto string requested in search.

for example, if "username" field filled out, add "and username '%$searchusername%'" string example. however, i'm not sure how proceed find out if there image (checking null won't work here) since if there is image need extract name of image can use or print out in results.

any appreciated.

will work? not sure if understand..

select * tbl imagename != '' , imagename != null 


edit:

if pick no, results not have images (blank/null field). if pick yes query will


have check user input , have 2 queries setup based on input. should know fields pull.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -