How to populate a tooltip with data using PHP and Metronics within a Table?

214 Views Asked by At

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>
0

There are 0 best solutions below