This topic is locked
[SOLVED]

 DATE Search Problem

12/15/2005 11:52:19 AM
PHPRunner General questions
D
defcon2000 author

On a the search screens if I put in on the normal search screen the following:


The resulting error is:


The other is as follows:


The resulting error is:


Any way to fix this or what is causing the problem?
This field is defined in the table as "date" only
Rgds,
Simon

T
Tommy B 12/15/2005

Any way to fix this or what is causing the problem?

This field is defined in the table as "date" only
Rgds,
Simon


I fixed this problem by defining my "date" field as "VARCHAR" since PHPRunner format it for me anyway. This may solve your problem if you don't mind the innacuracy.

D
defcon2000 author 12/15/2005

Thanks, I'll give it a shot.

Admin 12/16/2005

Hi,
thank you for pointing me to this bug. We'll fix it un the nect PHPRunner update.

To get your pages working now please modify

C:\Program Files\PHPRunner\source\include\functions.php file.

Locate the following snippet there:

else

$sSearchFor=db_addslashes($sSearchFor);

and replace it with:

else if(!IsDateFieldType($type))

$sSearchFor=db_addslashes($sSearchFor);

Then rebuild your project.
If you don't want to rebuild your project apply the same modifications to include\..._functions.php files in PHPRunner output folder.

D
dmarre 12/21/2005

When i try to do a search based on a date, i get no errors but the search comes back with no records. I have made the changes as specified above but still does not work.
I have tried to set my date field as varchar, date, and datetime. In MYSQL right now the table displays as 2005-12-01 00:00:00. PHPRunner returns a good value of 12/1/2005 on the PHP page, but when i type 12/1/2005 to search for those specific dates it says not records found.
EDITED:

I just did a search with this date format, 2005-12-01, and it found records. How can i make it search using regular date format like 12/1/2005?
Any ideas?

Admin 12/22/2005

Hi,
please use DATE or DATETIME type for your database field.

D
dmarre 12/22/2005

Change this field to DATE or DATETIME in MYSQL or the formatting portion of the phprunner?

Admin 12/22/2005

Please change this field type to DATE or DATETIME in MYSQL

D
dmarre 12/22/2005

I have to use DATETIME on the MYSQL because the program that is importing the date info into the table has issues importing to MYSQL with the field set to DATE. The date value gets truncated and does not place the correct value in mysql.
So i set the table in mysql to DATETIME, rebuilded the files and tried a search. Again, it will not find any records, whether it's in advance search or search on the list.php page, when i use the date value as 12/1/2005 or 12/01/2005. It only works if i use 2005-12-01 (which by the way is the same format that mysql uses to store the date, explains why it works with that format).
I have tried everything and still does not work. Please help. Thanks.

Admin 12/23/2005

Hi,
I wasn't able to reproduce this issue.

Please zip and send to support@xlinesoft.com the full set of generated PHP files along with your database creation script. I'll find what's wrong running your pgaes on my test box.

D
dmarre 12/24/2005

Hi,

I wasn't able to reproduce this issue.

Please zip and send to support@xlinesoft.com the full set of generated PHP files along with your database creation script. I'll find what's wrong running your pgaes on my test box.


Files have been sent to specified email address.

A
Alan4573 12/26/2005

Why not use a date picker in your search field?

This is set in the Formatting section.
Just make sure you set your date field to be edited as Date and Edit Format DD/MM/YYY dropdown box with datepicker. You can't enter the wrong format then..... That is of course if I'm reading your issue correctly.