Answer the question
In order to leave comments, you need to log in
How to pass date to Firebird?
tell me what is the problem? how to pass the date to SQ:L
After all, the date comes out in the right format
<?php
$strconnect = 'localhost';
if (!($db=ibase_connect($strconnect, 'sysdba', 'masterkey', 'ISO8859_1', 0, 1)))
die('nil ' . ibase_errmsg());
$d = date("d.m.Y");
echo $d;
$sql = "SELECT count(*) FROM P WHERE DATE = '$d'";
$cursor = ibase_query($sql);
$row_array = ibase_fetch_row($cursor);
print_r($row_array);
ibase_free_result($cursor);
ibase_close($db);
?>
Answer the question
In order to leave comments, you need to log in
1) DATE keyword, if you have such a field in the table, it must be surrounded by back quotes.
2) Table fields are wisely called in lower case and through underscore if the name contains several words
3) There is NOW () for skuel, which automatically substitutes the current date-time. You can use the date functions to generate a suitable format, the same DATE for example.
4) the date storage standard that most databases understand is "Ymd".
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question