DaDaBIK
This forum is devoted to the discussion about the software DaDaBIK database front-end
the PHP Database application generator for MySQL, PostgreSQL and SQLite; also available for Wordpress.

Welcome! Log In Create A New Profile

Advanced

Date problem with SQLite

Posted by Triton 
Date problem with SQLite
November 08, 2011 12:09PM
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
Re: Date problem with SQLite
March 03, 2012 06:51PM
Have you tried this fix found in the forum:
http://www.dadabik.org/forum/read.php?1,13744,14094#msg-14094

_______________________________
..:: Debbie |\.-./| DaDaBIK Support ::..
Re: Date problem with SQLite
March 24, 2012 04:22PM
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
Re: Date problem with SQLite
March 27, 2012 09:23AM
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

________________________________________________________
Eugenio |\.-./| DaDaBIK developer and project admin
Re: Date problem with SQLite
March 30, 2012 03:29AM
Moin,

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

Thanks for helping (and for the great software).

Heinz



Edited 1 time(s). Last edit at 03/30/2012 03:30AM by Triton.
Re: Date problem with SQLite
April 05, 2012 09:02AM
You are welcome!

________________________________________________________
Eugenio |\.-./| DaDaBIK developer and project admin
Sorry, only registered users may post in this forum.

Click here to login