How to make echo results in table hyperlinks

FantanSquad

I have retrieved data from DB and inserted into a html table however I want to make each value in the table a hyperlink to another page. Below I have tried making the pupil_id and link to a profile.php but all pupil_id values have now vanished!

(if (!isset($_POST['search'])) {
                    $pupils = mysql_query("SELECT * FROM pupil") or die("Cant find         Pupils");
                    $count = mysql_num_rows($pupils);
                    if ($count == 0) {
                        $totalpupil = "There are currently no Pupils in the system.";
                    } else {
                        while ($row = mysql_fetch_array($pupils)) {
                            ?>
                            <tr>
                                <td><?php echo '<a href="profile.php?id=' .$row['pupil_id'] . '"</a>' ?></td>
                                <td><?php echo $row['pupil_name'] ?></td>
                                <td><?php echo $row['class_id'] ?></td>                        
                            </tr>
                            <?php
                        }
                    }
                })

The finishing table should display every hyperlink as a hyperlink to another page. Any help?

Hanky Panky

Because your HTML is invalid, you are missing a closing > and you have no text defined for the hyperlink

<?php echo '<a href="profile.php?id=' .$row['pupil_id'] . '"</a>' ?>   //Wrong

Correct would be

<?php echo '<a href="profile.php?id='.$row['pupil_id'].'">'.$row['pupil_id'].'</a>'; ?>

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to make echo table with two div tag?

From Dev

PHP pdo echo results into table

From Dev

How make a table with php using the echo command with looping data?

From Dev

How would I make a value in a mysql table echo as something else?

From Dev

How make a table with php using the echo command with looping data?

From Dev

How to make inside html table in php echo a normal contest

From Dev

Hyperlinks or how to make url in java servlet

From Dev

How to echo results by sets of 2?

From Dev

html/mysql echo query results into table?

From Dev

PHP echo results in new table, not new row

From Dev

Echoing results as file hyperlinks

From Dev

how to make echo PHP link

From Dev

how to style php echo table

From Dev

How to echo query results in my view?

From Dev

How to make axis tick labels hyperlinks in D3.js

From Dev

How to make multiple JQuery pop up , on hyperlinks click?

From Dev

How to make hyperlinks line up right next to eachother with HTML

From Dev

How to make hyperlinks line up right next to eachother with HTML

From Dev

How not to show pasted hyperlinks as a hyperlinks?

From Dev

How can I include hyperlinks in a table within an Sweave document?

From Dev

create separate hyperlinks for group_concat and display the results into one table cell

From Dev

How can I make a echo in echo in laravel with curly braces?

From Dev

How to make echo compatible with read in bash?

From Dev

how to echo command (make a file) - batch file

From Dev

How to make php echo a sub section of an array

From Dev

How would i make my project search a database and return results to table

From Dev

How to echo data into 3 columns in a table in php?

From Dev

How to display PHP echo in a HTML table?

From Dev

how to echo a hyperlink in a html table via php

Related Related

  1. 1

    How to make echo table with two div tag?

  2. 2

    PHP pdo echo results into table

  3. 3

    How make a table with php using the echo command with looping data?

  4. 4

    How would I make a value in a mysql table echo as something else?

  5. 5

    How make a table with php using the echo command with looping data?

  6. 6

    How to make inside html table in php echo a normal contest

  7. 7

    Hyperlinks or how to make url in java servlet

  8. 8

    How to echo results by sets of 2?

  9. 9

    html/mysql echo query results into table?

  10. 10

    PHP echo results in new table, not new row

  11. 11

    Echoing results as file hyperlinks

  12. 12

    how to make echo PHP link

  13. 13

    how to style php echo table

  14. 14

    How to echo query results in my view?

  15. 15

    How to make axis tick labels hyperlinks in D3.js

  16. 16

    How to make multiple JQuery pop up , on hyperlinks click?

  17. 17

    How to make hyperlinks line up right next to eachother with HTML

  18. 18

    How to make hyperlinks line up right next to eachother with HTML

  19. 19

    How not to show pasted hyperlinks as a hyperlinks?

  20. 20

    How can I include hyperlinks in a table within an Sweave document?

  21. 21

    create separate hyperlinks for group_concat and display the results into one table cell

  22. 22

    How can I make a echo in echo in laravel with curly braces?

  23. 23

    How to make echo compatible with read in bash?

  24. 24

    how to echo command (make a file) - batch file

  25. 25

    How to make php echo a sub section of an array

  26. 26

    How would i make my project search a database and return results to table

  27. 27

    How to echo data into 3 columns in a table in php?

  28. 28

    How to display PHP echo in a HTML table?

  29. 29

    how to echo a hyperlink in a html table via php

HotTag

Archive