Hi Guys I need help. I have a table and when I clicked the table row(PID 1 below) Ill get the info of the row 1(PID) and pass it on the other form(form2). Thank You in advance.

pid  prno
1    one
2    two

this is my code in loading the table and I do not know how to pass the clicked row.

<table> <?php
    $loadp= "SELECT * from tbl1 b inner join tbl2 c on b.logid = c.logid";
    $res = mysqli_query($con, $loadp);
    if (mysqli_num_rows($res) > 0) {
    while($rowa = mysqli_fetch_assoc($res)) {
    echo "<tr> <td>".$rowa['pid']."</td>.
        <td><a href='#'>".$rowa['prno']."</a></td>" . 
        </tr>";
    } //while
    }else{
        echo "0 results";
    //else
    }
?> <table> 

Recommended Answers

All 3 Replies

echo "<tr><td>" . $rowa['pid'] . "</td><td><a href='yourpage.php?id={$rowa['pid']}'>" . $rowa['prno'] . "</a></td></tr>";

Hi sir, thank you for your reply.
in my form or page 2 how can i retrieve the id? Thank You.

Gotcha, I used $_GET['id']; Thank You for your help.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.