Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <meta charset="utf-8">
- </head>
- <?php
- include("connect.php");
- $sql = "SELECT * FROM orderdetaljer, orders, kund WHERE orderdetaljer.orderid = orders.orderid AND orders.kundid = kund.kundid ORDER BY orderdetaljer.orderid" ;
- $result = mysqli_query($conn,$sql) or die(mysqli_error($conn));
- $newId = false;
- $lastOrderID = 0;
- function last(){
- global $lastOrderID;
- return $lastOrderID;
- }
- function setLast($last){
- global $lastOrderID;
- $lastOrderID = $last;
- }
- while($row = $result->fetch_assoc() ) {
- $lastOrderID = last();
- $thisOrderId =$row["orderid"];
- if($lastOrderID!=$thisOrderId){
- echo "<input type='checkbox' name=$row[orderid] value='Bike'> ";
- echo " Namn: " . $row["fnamn"];
- echo ", OrderId: " . $row["orderid"]. ", ProdId: " . $row["prodid"]. ", Amount: " . $row["antal"] . ", Adress: " . $row["adress"]. ", OrderDatum: " . $row["orderdate"] . ", SendDatum: " . $row["senddate"];
- }else{
- echo "OrderId: " . $row["orderid"]. ", ProdID: " . $row["prodid"]. ", Amount: " . $row["antal"] . " ";
- }
- echo "<br/><br/>";
- setLast($thisOrderId);
- }
- ?>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement