Jump to content

Prob with date query


kraadde

Recommended Posts

I have a problem.
I programmed a query to check whether a database field containing a year value (typ varchar(4)) is within a given intervals. The script is like that:

$sqlAB="SELECT ......, year FROM ....
WHERE
.....
AND year >= '$txYearFrom'
AND year <= '$txYearTo'
AND ....
order by ...";


$txYearFrom .. To are a text strings which I read out from input fields like that:
<input name="txYearFrom" type="text">

The query result is sometimes wrong. How can I fix that and get reliable results?
Btw the database structure can not be changed...

Thanks all for a good idea...

Adriano
[email protected]
Link to comment
https://forums.phpfreaks.com/topic/32682-prob-with-date-query/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.