Skip to content

Instantly share code, notes, and snippets.

@darkcolonist
Forked from anonymous/test.php
Last active April 6, 2017 09:43
Show Gist options
  • Save darkcolonist/10ca03d87efe1f9dbfd1380b40ae9237 to your computer and use it in GitHub Desktop.
Save darkcolonist/10ca03d87efe1f9dbfd1380b40ae9237 to your computer and use it in GitHub Desktop.
test
$result = $conn->query($sql);
if ($result->num_rows > 0) {
$showHeader = true;
$firstRow = $result->fetch_assoc();
if ( true === $showHeader ) { // to achieve a 'single header'
$showHeader = false; // avoid other headers
echo 'Receipt #: ' . $firstRow[0]['info'] . '<br><br>';
echo 'Table #: ' . $firstRow['tid'] . '<br>';
echo 'Client #: ' . $firstRow['cid'] . '<br>';
echo 'Date: ' . date('Y-m-d h:i A', strtotime($firstRow['date'])) . '<br>';
}
while($row = $result->fetch_assoc()) {
$oid = $row{'oid'};
$product = $row['pname'];
$groupidx = $row['groupid'];
$printreceipt = $row['printreceipt'];
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment