how to get button for every record from mysql code example
Example: how to get button for every record from mysql
<html>
<form method = "GET" action = "copytrade.php">
<?php
require('connect.php');
$query = "SELECT * FROM trade_history1 ";
$result = mysql_query($query);
echo "<table border = '1px'>";
echo "<tr><td>" . "ID" . "</td><td>" . "Date" . "</td><td>" . "Type" . "</td><td>" . "Size" . "</td><td>" . "Currency Pair" . "</td><td>" . "Entry" . "</td><td>" . "Stoploss" . "</td><td>". "Take Profit" . "</td><td>" . "Date Close" . "</td><td>" ."Close" . "</td><td>" ."Profit/Loss"."</td><td>" ."Copy"."</td><td>Copy</td></tr>" ;
while($row = mysql_fetch_array($result)){
echo "<tr><td>" . $row['id'] . "</td><td>" . $row['date'] . "</td><td>" . $row['type'] . "</td><td>" . $row['size'] ."</td><td>" . $row['currency_pair'] ."</td><td>" . $row['entry'] ."</td><td>" . $row['stoploss'] ."</td><td>" . $row['takeprofit'] ."</td><td>" . $row['dateclose'] ."</td><td>" . $row['close'] ."</td><td>" . $row['profitloss'] . "</td><td>a href='copytrade.php?id=" .$row['id'].'">copy</a></td></tr>"; //$row['index'] the index here is a field name
}
echo "</table>";
mysql_close();
?>
<input type = "submit" name = "copy" value = "copy"/></form>
</html>