displays Profiles with a Similar Job Title and Industry in php
Tags: phpsql
Published: 2020-05-30 11:56:13

0


Sample table: cemployees

+--------+-----------+-----------+----------+--------------+------------+-----------+
| cempid | FName     | LName     | EMAIL    | PHONE_NUMBER | title      | companyID |
+--------+-----------+-----------+----------+--------------+------------+-----------+
|    100 | Steven    | King      | SKING    | 515.123.4567 | IT_PROG    | 1241      |
|    101 | Neena     | Kochhar   | NKOCHHAR | 515.123.4568 | IT_PROG    | 1241      |
|    102 | Lex       | De Haan   | LDEHAAN  | 515.123.4569 | IT_PROG    | 1241      |
|    103 | Alexander | Hunold    | AHUNOLD  | 590.423.4567 | IT_PROG    | 1241      |
|    104 | Bruce     | Ernst     | BERNST   | 590.423.4568 | FI_MGR     | 1242      |
|    105 | David     | Austin    | DAUSTIN  | 590.423.4569 | FI_MGR     | 1242      |
|    106 | Valli     | Pataballa | VPATABAL | 590.423.4560 | FI_MGR     | 1242      |
|    107 | Diana     | Lorentz   | DLORENTZ | 590.423.5567 | IT_PROG    | 1242      |
|    108 | Nancy     | Greenberg | NGREENBE | 515.124.4569 | FI_ACCOUNT | 1300      |     
|    109 | Daniel    | Faviet    | DFAVIET  | 515.124.4169 | FI_ACCOUNT | 1300      |
|    110 | John      | Chen      | JCHEN    | 515.124.4269 | FI_ACCOUNT | 1300      |
+--------+-----------+-----------+----------+--------------+------------+--
Sample table: company

+-------------------+----------+---------+--------+-------+-----+------------+
| CompanyName       | scat_id  | Address | City   | State | Zip | companyID  |
+-------------------+----------+---------+--------+-------+-----+------------+
| SAGEM SA          | 111      |         |        |       |     | 1241       |
| Aguila Ammunition | 112      |         |        |       |     | 1242       |
+-------------------+----------+---------+--------+-------+-----+---------

What I want:

When I click the First Name a profile.php will open and in one place of a profile.php displays Profiles with a Similar Job Title and Industry

Example

Click Steven and Neena, Lex, and Alexander's profile will display in profile.php because their job title is the same as Steven. Display First and Last name and their company name

What I am tried-

<?php
                            require_once 'tabconnect.php';
                                if (isset($_GET['id'])) {
                                    $id = $_GET['id'];
                                        $query1 = mysqli_query($connection,"SELECT cemployees.cempid,cemployees.FName,cemployees.companyID,cemployees.title,company.CompanyName FROM cemployees JOIN company ON company.companyID=cemployees.companyID WHERE cemployees.cempid='id' OR cemployees.spcode='PMS' LIMIT 5");
                                            while ($row2 = mysqli_fetch_array($query1)) {
                        ?>
                                            <!-- Displaying Data Read From Database -->                                     
                                                <?php echo $row2['FullName']; ?><br>
                                                                                            <span class="profilePage-profileSection_info-company"><?php echo $row2['CompanyName']; ?></span><hr style=" border: transparent">


                        <?php
                                }
                                }
                        ?>

I asked this question in stackoverflow

https://stackoverflow.com/questions/62056228/displays-profiles-with-a-similar-job-title-and-industry-in-php