I've been working on another database that I can't figure out how to set up and execute properly. The database will consist of... id primary auto_incr item varchar(255) price varchar(255) bulk null Now I'm not sure what to do about the 'bulk'. Let me explain how I want it to work. If the admin clicks the radio box for 'bulk', in the query it will leave a checkmark. That checkmark will be an image from inside my server (or even from any url for that matter). If the user DOESN'T click bulk, then nothing will appear. I was wondering how I should setup the database, as well as what I should do for the query. The query will simply get and display the item name, price and a checkmark if the bulk option is selected all within a table. Im thinking something like I normally do. Put the values into variables and then call them with the query, but I never done a query with an if then statement (which is what I'm thinking I have to do. If checkbox/radio is selected, then paste image. I'm also assuming I can place the image location inside of a variable, but again, never done that so I'm not sure how/if it will work). edit: hate asking so many php questions, but you guys and gals are really helpful.
Not sure I follow you but... bulk can be char(1) and be either y/n depending on the check tinyint(3) and be either 0/1 binary and hold the contents of the image file (if the image is specific to the user)
Yeah I understand that, but how do I bring up the image, if bulk is 1 (as in the boolean for true). Do I store it in a variable before running the query? kinda like... if bulk = 1 then print (image here) else do nothing.
I'd do if bulk=1 then echo "<img src='/showimage.php?id=$id'>" and showimage.php gets the image code, outputs the appropriate headers and shows the image.