job search proj

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tuananh87vn
    New Member
    • Sep 2007
    • 63

    #1

    job search proj

    hi, i'm building a simple db system for a job search service which I will later use php to complete it. i'm using mysql for this and here is my plan:

    table user
    - ID
    - Name
    - Email
    - Password
    - LastLogin

    table desire (which should be presented as multivalued attribute in ERD form)
    - userid (=user.userid)
    - desire1
    - desire2
    - desire3

    table Employment
    - ID
    - Category
    - Position (Title)
    - Employer (= employer.id)
    - SalaryRange
    - Description
    - Requirement

    table Employer:
    - ID
    - Company
    - Representative
    - Address
    - Phone
    - Email
    - Password

    users login to the site and search for the job suitable to them. when login there's some statistic such as new/total jobs, last login time, and job which is suitable to them

    when ppl register, they check at most 3/10 job categories which are of their design, then the system will match them with all the employment available and give out a number of this user's suitable job

    I may user some query like this[php]
    select desire.d1,desir e.d2,desire.d3 from desire where desire.userid = user.userid;
    ...
    $sql="select * from table where (desire.d1=empl oyment.category ) OR
    (desire.d2=empl oyment.category ) OR (desire.d3=empl oyment.category )";

    $count=mysql_nu m_rows($sql);[/php]so the value that $count holds is the numbers of job which is suitable to the current user? is that true?
    ...
    so afterall, is my plan feasible?any comment to help me develop or correct it?

    thanks!
    Last edited by ronverdonk; Apr 17 '08, 05:53 PM. Reason: use code tags!
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    No, you have to execute the sql query before you can count the number of returned results. So it should be something like:[php]$sql="select * from table where (desire.d1=empl oyment.category ) OR
    (desire.d2=empl oyment.category ) OR (desire.d3=empl oyment.category )";
    $result=mysql_q uery($sql)
    or die ("Error selecting: ".mysql_error() );
    $count=mysql_nu m_rows($sql);
    [/php]Now $count holds the number of rows that fulfill the SQL query conditions.

    Ronald

    Comment

    Working...