Skip to content

Instantly share code, notes, and snippets.

@podhy
Created November 22, 2014 07:51
Show Gist options
  • Save podhy/74dda3595869e59cc3f1 to your computer and use it in GitHub Desktop.
Save podhy/74dda3595869e59cc3f1 to your computer and use it in GitHub Desktop.
<?php
$join = [];
if ($something)
{
$join[] = "LEFT JOIN tabulka ON podminkaa = podminkab";
}
echo "SELECT * FROM product " . implode(" ", $join) . " WHERE active = ?";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment