catfan / Medoo

The lightweight PHP database framework to accelerate the development.
https://medoo.in
MIT License
4.83k stars 1.15k forks source link

SQL functions should be case insensitive #467

Closed adius closed 6 years ago

adius commented 8 years ago

This does not work:

$insertId = $database->insert('vouchers', [
  'code' => $code,
  'value' => $value,
  '#expires' => "from_unixtime($timeStamp)",
]);

But this does:

$insertId = $database->insert('vouchers', [
  'code' => $code,
  'value' => $value,
  '#expires' => "FROM_UNIXTIME($timeStamp)",
]);

SQL is case insensitive and therefore both versions should work!

catfan commented 6 years ago

Check out the new feature raw object https://medoo.in/api/raw. Case insensitive also works, but we recommend capitalize with this for better readability.