Jump to content
Larry Ullman's Book Forums

How Can I Create This Sql Query?

Recommended Posts

hi.. everyone..


This is a sql query problem that I have uncounted and have been in the same script for hours. But Still I couldn't get it to work.


I need to get a image from database and its type should be one of a value from my $designation array. The query should check $designation array's value with database and if its match with one of a value in database then query can retrieve one row.


This is my designation array. its value I use for image type in my db.


$designation = array ( 'Managing Director', 'Manager', 'Director', 'The Principal', 'Deputy Principal', 'Proprietor', 'Assistant Manager', 'Head Master');


My problem is how can I check these value exit in my table and how can I make a query for this. In query where condition is confusing to me...


any comments are greatly appreciated.

Thank you..

Link to comment
Share on other sites

thanx for response.


My table is institute_images and it has image_id, image_name, image_type, institute_id coloumns. designation array's values I use for image_type values. In my query I need to check is there any images in db with image_type value is one of my designation array's value.

Link to comment
Share on other sites

I have read it half. (till 7 chapter) .. why is it??


Well i think if you did read, understand and finished this book most of your questions would be answered. I would suggest to anyone that before they began to develop stuff that they at least had the basics in their pocket.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...