0

I am using Metronics framework for the frontend. I want to be able to hover my mouse over a table underneath a column and display the data on the tooltip. How can you do this with PHP and HTML without jQuery? I have tested to see if the get request works and all the data such as patient ID, name, DOB and details work has appeared with echo. Now I need two attributes to be displayed on the tooltip button the Details and DOB when hovering underneath one column called Patient Name. Sorry for other reasons I can only provide one column.

below I can loop through all the data and echo it out on the page perfectly. Im not using any framework for the backend

                   while($row = mysql_fetch_array($query)) {

                    echo "id: " . $PatientName = $row["Patient_name"]. " - Name: " . $Date_of_Birth= $row["Date_of_Birth"]. " " . $Details= $row["Patient_Details"]. "<br>";

                    }

Tooltip html code below I've tried to place the varaibles in the data contents and whenever I hover my mouse underneath the Patient name column nothing appears.

                  <table>
                        <td>Patient_Name </td>
                        <tr>
                            <!--<td></td>-->            
                            <td>
                            <button type='button' class='reset-button-style' data-toggle="tooltip" data-trigger='hover' data-placement="left"
                             title="bye" data-content="$Detils" data-content="$Date_of_Birth">
                            
                              <?php echo $PatientName; ?> // list of patient names 

                            </button>               
                            
                            </td>   

                        </tr>

                    </table>
NoBody
  • 53
  • 8
  • 1
    `data-content` twice? Why use `` for the patient name but not inside your `data-content`? Also, `$Detils` vs `$Details` – brombeer May 06 '21 at 16:21
  • Thank you brombeer I placed ?php echo ... ?> in the data-content and it worked thanks – NoBody May 06 '21 at 17:54
  • 2
    **Warning:** `mysql_*` extension is deprecated as of PHP 5.5.0, and has been removed as of PHP 7.0.0. Instead, either the [mysqli](https://www.php.net/manual/en/book.mysqli.php) or [PDO_MySQL](https://www.php.net/manual/en/book.pdo.php) extension should be used. See also the [MySQL API Overview](https://www.php.net/manual/en/mysqlinfo.api.choosing.php) for further help while choosing a MySQL API. – Dharman May 06 '21 at 17:57

0 Answers0