sashavalentina Posted June 24, 2021 Share Posted June 24, 2021 I want to output the data and also the buttons in my php codes. But i do not know why the buttons does not output as coded. Can anyone let me know where did my codes go wrong? I've been searching it but i cant't find the problem. Thanks in advance. <?php if(isset($_POST['invoice_details'])) { $discountsql = "INSERT INTO `invoice_price` (`order_id`) VALUES ('.$order_id.') "; $conn->query($discountsql); } ?> <?php $sql2 = " SELECT order_id FROM ordered_items GROUP BY order_id WHERE order_id = '".$row[order_id]."' "; $query2 = $conn -> query($sql2); while ($row2 = $query2 -> fetch_assoc()) { ?> <div class="col-12 form-group"> <p> <?php echo $row2['order_id']; ?></p> <p class="text-success" pointer-events="none" style="font-weight: bold; font-size: 25px; text-align:center; ">Your order is confirmed !</p> <a href="order-list.php"> <input class="btn btn-block checkoutbtn" type="button" name="invoice_details" value="Go to Order Page"> </a> </div> <?php } ?> Quote Link to comment https://forums.phpfreaks.com/topic/312969-output-of-button-does-not-displayed/ Share on other sites More sharing options...
requinix Posted June 24, 2021 Share Posted June 24, 2021 It probably doesn't work because your "button" is actually a link. But I don't actually know what "output" you're trying to get... Quote Link to comment https://forums.phpfreaks.com/topic/312969-output-of-button-does-not-displayed/#findComment-1587514 Share on other sites More sharing options...
sashavalentina Posted June 24, 2021 Author Share Posted June 24, 2021 1 hour ago, sashavalentina said: <p> <?php echo $row2['order_id']; ?></p> 18 minutes ago, requinix said: It probably doesn't work because your "button" is actually a link. But I don't actually know what "output" you're trying to get... This is the output i'm trying to get Quote Link to comment https://forums.phpfreaks.com/topic/312969-output-of-button-does-not-displayed/#findComment-1587515 Share on other sites More sharing options...
requinix Posted June 24, 2021 Share Posted June 24, 2021 That comes from $sql2 = " SELECT order_id FROM ordered_items GROUP BY order_id WHERE order_id = '".$row[order_id]."' "; this query. So if this query isn't working then your next step is to learn more about $row. Quote Link to comment https://forums.phpfreaks.com/topic/312969-output-of-button-does-not-displayed/#findComment-1587516 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.