Date problem with SQLite

Triton

New member
Hi,

I'm using DaDaBik and SQLite and it works great.

Only one thing i don't get to work:

An insert_date , update_date or date field-type results in this output: --1992

I tried every combination of content_type and SQLite-Datatypes - everytime the same problem.

Is there a solution to this ?

Thanks
 

Triton

New member
Hi,

i solved my problem - here is my solution:

the changes i made to display the correct Date-Values with SQLite (DaDaBIK 4.4beta):

File: business_logic.php

Line 2305:

change

$sql .= format_date_for_dbms($mysql_date_value).", "; // add the field value to the sql statement

into

$sql .= "'".$mysql_date_value."', ";


and

Line 2352:

change

$sql .= format_date_for_dbms(date("Y-m-d")).", "; // add the field name to the sql statement

into

$sql .= "date("."'"."now"."'".")".", ";


and

Line 2461:

change

$sql .= format_date_for_dbms(date("Y-m-d")).", "; // add the field name to the sql statement

into

$sql .= "date("."'"."now"."'".")".", ";


Line 2472:

change

$sql .= format_date_for_dbms($mysql_date_value).", "; // add the field value to the sql statement

into

$sql .= "'".$mysql_date_value."', ";



with these changes my Installation worked like charm...

Thanks to DebbieS for the reply

Thanks to the DaDaBIK-Team for DaDaBIK

Heinz
 

eugenio

Administrator
Staff member
Hi,
thanks for having reported the problem. Yes, it is definitely a bug.
You should get the right behavior even if you just change

function format_date_for_dbms($date)
{
return $date;
}

to
function format_date_for_dbms($date)
{
return "'".$date."'";
}

in include/db_functions_pdo.php
 

Triton

New member
Moin,

your solution is much more elegant - so this is what i'm using now...

Thanks for helping (and for the great software).

Heinz
 
Top