Friday, August 30, 2013

How do I store the contents of tables rows and use them on another page?

How do I store the contents of tables rows and use them on another page?

I am a beginner to web development and am just wondering how I can store
the values of a table row and use them on another page.
At the moment I am retrieving values from a database and putting them into
a table. Each row has a submit button which should take them to a pay.php
page where it should list the details of the particular row that they
selected to pay.
while($row = mysql_fetch_array($result))
{
echo "<td>" . $row['P_name'] . "</td>";
echo "<td>" . $row['P_amount'] . "</td>";
echo "<td>" . $row['P_dateStart'] . "</td>";
if(is_null($row['P_datePaid'])){
echo "<td>Not Paid</td>";
}
else{
echo "<td>" . $row['P_datePaid'] . "</td>";
}
if($row['P_status'] == 0){
echo "<td bgcolor='#FF0000'>" . $row['P_status'] . "</td>";
}
else{
echo "<td bgcolor='#00FF00'>" . $row['P_status'] . "</td>";
}
echo "<td><form name = 'viewMore' action = 'viewMore.php'><input
type = 'submit' value = 'View More'></form></td>";
echo "<td><form name = 'pay' action = 'pay.php'><input type =
'submit' value = 'Pay'></form></td>";
echo "</tr>";
}
echo "</table>";
?>

No comments:

Post a Comment