Search
 
SCRIPT & CODE EXAMPLE
 

SQL

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 "; //You don't need a ; like you do in SQL
$result = mysql_query($query);

echo "<table border = '1px'>"; // start a table tag in the HTML
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>" ;  //$row['index'] the index here is a field name

while($row = mysql_fetch_array($result)){   //Creates a loop to loop through results
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>"; //Close the table in HTML

mysql_close(); //Make sure to close out the database connection
?>

<input type = "submit" name = "copy" value = "copy"/></form>
</html>
Comment

PREVIOUS NEXT
Code Example
Sql :: kie business put user infos in database 
Sql :: sql select upcoming birthdays 
Sql :: ora 00001 error catch plsql 
Sql :: importing multiple xml files in azure sql database 
Sql :: mysql utc to toronto time 
Sql :: sql interview questions 
Sql :: SQLSTATE[HY000] [2002] No connection could be made because the target machine actively refused it (SQL: select * from `featured_categories` limit 1) 
Sql :: how to fetch first 10 rows in sql 
Sql :: subquery 
Sql :: oracle find constraints referencing a table 
Sql :: how to run sql query in mysql workbench 
Sql :: join multiple tables 
Sql :: sqlite describe table 
Sql :: Extract Data from SQL Server into XML Format 
Sql :: sql into vs insert into 
Sql :: update sqlaclehmy sqlalchemy.orm.evaluator.UnevaluatableError: Cannot evaluate BinaryExpression with operator <function like_op at 0x03CF1DF0 
Csharp :: guid.empty 
Csharp :: unity hide mouse 
Csharp :: unity cycle children 
Csharp :: how to detect a mouse click in unity 
Csharp :: check if string is email c# 
Csharp :: vue.createapp is not a function 
Csharp :: c# error messagebox 
Csharp :: c# new line in messagebox 
Csharp :: unity 3d camera rotate up and down 
Csharp :: Publishing A Single EXE File In.NET Core 
Csharp :: c# copy to clipboard 
Csharp :: serilog loglevel order 
Csharp :: how to find the mouse position unity 
Csharp :: c# read file into a string 
ADD CONTENT
Topic
Content
Source link
Name
4+5 =