3v4l.org

run code in 300+ PHP versions simultaneously
<?php function showOrders($con) { if (!con) { echo "No Connection"; // mysqli_connect_error() <-- use this to debug, but don't show this live } elseif (!$pending_orders = mysqli_query($con, "SELECT OrderNum, product_id, product_color, product_size, product_quality, date, status FROM `Purchase_Order` WHERE status = 'pending' ORDER BY date ASC")) { echo "Pending Orders Query Syntax Error"; // mysqli_error($con) <-- use this to debug, but don't show this live } elseif (!mysqli_num_rows($pending_orders)) { echo "No Pending Orders In Database"; } else { echo '<form action ="PurchaseOrders.php"><table style="border: 1px solid black; border-collapse: collapse; width: 1300px; margin-bottom: 50px; margin-top: 5px; font-size:20px;"> <tr style="border :1px solid black; background-color: black; color: whitesmoke"> <th>ORDER #</th> <th>PRODUCT ID</th> <th>COLOR</th> <th>SIZE</th> <th>QTY</th> <th>DATE ORDERED</th> <th>STATUS</th> </tr>'; while($row = mysqli_fetch_array($pending_orders)) { /* use css to alternate background color if($counter% 2 == 0) { $bg = 'rgba(50,205,50, 0.2);'; } else { $bg = ''; } */ // if ($status === "shipped") { $newstat = "pending"; } else { $newstat = "shipped"; } // omit, this is impossible echo '<tr>'; // use css styling to alternate background color echo "<td>{$row['OrderNum']}</td>"; echo "<td>{$row['product_id']}</td>"; echo "<td>{$row['product_size']}</td>"; echo "<td>{$row['product_color']}</td>"; echo "<td>{$row['product_quantity']}</td>"; echo "<td>{$row['date']}</td>"; echo "<td><select name=\"status\" onchange=\"ship('{$row['OrderNum']}','{$row['product_id']}')\"><option>pending</option><option>shipped</option</td>"; echo '</tr>'; } echo "</form>"; } }
Output for git.master, git.master_jit, rfc.property-hooks

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
132.34 ms | 405 KiB | 5 Q