Jump to content

Mysql Search query


pankaj.ghadge
 Share

Recommended Posts

My database structure is+----------------------+--------------+------+-----+---------+----------------+| Field | Type | Null | Key | Default | Extra |+----------------------+--------------+------+-----+---------+----------------+| ID | int(11) | NO | PRI | NULL | auto_increment | | UserID | int(11) | YES | | NULL | | | HighestQualification | varchar(30) | YES | | NULL | | | University | varchar(30) | YES | | NULL | | | Skill | varchar(50) | YES | | NULL | | | ExperienceInYear | int(11) | YES | | NULL | | | ExperienceInMonth | int(11) | YES | | NULL | | | Designation | varchar(80) | YES | | NULL | | | SalaryPerYear | int(11) | YES | | NULL | | | ResumePath | varchar(170) | YES | | NULL | | | CreatedOn | date | YES | | NULL | | | CreatedBy | int(11) | YES | | NULL | | | LastEditedOn | date | YES | | NULL | | | LastEditedBy | int(11) | YES | | NULL | | +----------------------+--------------+------+-----+---------+----------------+ I have taken 3 fields as bellow1)keyword : (text box contain values separated by comma like c,c++,java,mca,mcs).2)experience: first textbox is year, second text box month. suppose he enters 11 year 3 month. I want to find the records which has more experience than this.3)location (text box is for location)4)Search buttonplease tell me how to write a query for this.........please

Link to comment
Share on other sites

  • 2 weeks later...

a. for the love of my eyes, put the DB information in a codebox, so it is readable (it preserves tabs/space formatting)b. what you are trying to do would require quite a bit of scripting before and after the query to get to do what you want (either that, or a ridiculously complex query for only using 1 table)steps would be:(before 1: change your experience fields to just 1, and make it months, so then you don't have to keep track of 2 variables, if you want the final output in years, just divide by 12, remainder is months)1. separate each keyword in the keyword field2. try to identify the type of keyword (ie: is the keyword a skill, university), if it can't be identified, leave as is3. convert the years/months fields into just months (years*12 + months)4. create your SQL query5. format/display results

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...