how to get button for every record from mysql 1

how to get button for every record from mysql


"; // start a table tag in the HTML echo "" . "ID" . "" . "Date" . "" . "Type" . "" . "Size" . "" . "Currency Pair" . "" . "Entry" . "" . "Stoploss" . "". "Take Profit" . "" . "Date Close" . "" ."Close" . "" ."Profit/Loss"."" ."Copy"."Copy" ; //$row['index'] the index here is a field name while($row = mysql_fetch_array($result)){ //Creates a loop to loop through results echo "" . $row['id'] . "" . $row['date'] . "" . $row['type'] . "" . $row['size'] ."" . $row['currency_pair'] ."" . $row['entry'] ."" . $row['stoploss'] ."" . $row['takeprofit'] ."" . $row['dateclose'] ."" . $row['close'] ."" . $row['profitloss'] . "a href='copytrade.php?id=" .$row['id'].'">copy"; //$row['index'] the index here is a field name } echo ""; //Close the table in HTML mysql_close(); //Make sure to close out the database connection ?>

Here is what the above code is Doing:
1. It’s connecting to the database
2. It’s selecting all the rows from the trade_history1 table
3. It’s displaying the table in a nice format
4. It’s displaying a link to copytrade.php?id=1
5. It’s closing the database connection

Now, let’s look at the copytrade.php file:

Similar Posts