SQLBooleanValue() public static method

[STATIC] Converts a boolean into a formatted TRUE or FALSE value of choice
public static SQLBooleanValue ( mixed $value, mixed $trueValue, mixed $falseValue, string $datatype = self::SQLVALUE_TEXT ) : string
$value mixed value to analyze for TRUE or FALSE
$trueValue mixed value to use if TRUE
$falseValue mixed value to use if FALSE
$datatype string Use SQLVALUE constants or the strings: string, text, varchar, char, boolean, bool, Y-N, T-F, bit, date, datetime, time, integer, int, number, double, float
return string SQL formatted value of the specified data type
Example #1
0
foreach ($tables as $table) {
    echo $table . "<br />\n";
}
// --- Show the columns (field names) in a table --------------------
$columns = $db->GetColumnNames("test");
foreach ($columns as $column) {
    echo $column . "<br />\n";
}
// --- Find a column (field) type and length ------------------------
echo "Type: " . $db->GetColumnDataType("Color", "Test") . "<br />\n";
echo "Length: " . $db->GetColumnLength("Color", "Test") . "<br />\n";
// --- Get a column's ordinal position (the column number) ----------
echo $db->GetColumnID("Age", "Test") . "<br />\n";
// --- Check for errors ---------------------------------------------
if ($db->Error()) {
    echo "<h3>" . $db->Error() . "</h3>\n";
} else {
    echo "<p>There were no errors</p>\n";
}
// --- Format some values ready for SQL -----------------------------
// You do not have to create the object to use these. Simply include
// the class in your PHP file. These are called "Static" methods.
echo "<br /><br />\n\n";
echo MySQL::SQLValue("Let's format some text") . "<br />\n";
echo MySQL::SQLValue(date("m/d/Y"), MySQL::SQLVALUE_DATE) . "<br />\n";
echo MySQL::SQLValue(123, MySQL::SQLVALUE_NUMBER) . "<br />\n";
// --- Format some values ready for SQL based on a boolean value ----
echo MySQL::SQLBooleanValue(false, "1", "0", MySQL::SQLVALUE_NUMBER);
echo MySQL::SQLBooleanValue("ON", "Ya", "Nope");
echo MySQL::SQLBooleanValue(1, '+', '-');