Sunday, 15 April 2012

php - display details of a specific row of a table -



php - display details of a specific row of a table -

i have table displays list of items. 1 column of table hyperlinked page. when ever item on column clicked redirected page displays info of specific row column item clicked. e.g

id name class 1 7th

whenever clicked details of entire row class etc should displayed on other page

part of table code

<td><a href="therapist_view_office.php?<?php $_get['id=".$row[id]."'];?>"><?php echo $row['office_name']; ?> </a> </td>

code therapist_view_office.php page

<?php $con=mysqli_connect("localhost","root","","db"); // check connection if(mysqli_connect_errno()) echo "failed connect mysql: " . mysqli_connect_error(); // escape variables security $id = $_get['id']; $office_name = mysqli_real_escape_string($con, $_post['office_name']); echo "<div class='brand'>"; $result = mysqli_query($con,"select office_name office id='".$id."'"); while($row = mysqli_fetch_array($result)) { echo $row['office_name']; } echo "</div>"; ?>

problem not able carry id of row first page therapist_view_office.php page due not getting result(i.e office_name). url getting on sec page www.xyz.com?therapist_view_office.php?

change in code :

<td><a href="therapist_view_office.php?id=<?php echo $row['id'];?>"><?php echo $row['office_name']; ?> </a> </td>

php mysql sql mysqli phpmyadmin

No comments:

Post a Comment