Jump to content

Search the Community

Showing results for tags 'php mysql match results'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. I was wondering if anyone could help me. A customer completes an assessment, each answer is a radio value between 1-5 and there are 10 questions. So therefore; Assessment Table assessmentid | studentid | q1 | q2 | q3.....q10 1 - 1001 - 1 - 5 - 3 - 2 The careers table has 10 careers which are each rated between 1-5 (this is set for each career) Careers Table careerid | careername | q1 | q2 | q3.....q10 1 - Doctor - 5 - 2 - 1 - 3 Im trying to create a results page which will check one sequence against another such as q1 in the assessment table against q1 in the careers table. To explain further, the user will input a value between 1-5 for question 1. This will be matched for the q1 value for career1. This will be repeated for each question up until question 10. The overall result (% match) will be displayed - i.e. the %match for the user and that particular career. This process will then be repeated for all remaining careers. I want the results to be shown in descending order and only display the top 5. The results should be shown as Career Name (result % match) Hyperlink (to external website) At the minute I have it working but it has quite a lot of queries such as: <?php $career1sequence1 = mysql_result (mysql_query ("SELECT `q1` FROM `careers` WHERE `careerid ` = '1'"), 0): $question1 = mysql_result (mysql_query ("SELECT `q1` FROM `assessment` WHERE `studentid` = $session_studentid"), 0); ?> <?php $career1result1 = $question1/$career1sequence1; if ($career1result1>1) { $career1result1 = $careersequence1/$question1 ?> This query is repeated for every question input/career sequence value. Would anyone know if there is an easier way to do this that is more straightforward? Any help is appreciated.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.