karthikeyan_coder Posted November 1, 2006 Share Posted November 1, 2006 Hello, i am getting the values from mysql table... that field type is "TEXT" values are most likely "20061028025416" .. i need to check weater this value is lesser than or equal to 20061108025416 how it is possible? once i cast it as (int) then all of my values are tured in to "2147483647 " Thank you. Link to comment https://forums.phpfreaks.com/topic/25872-just-an-if-statement-with-numbers-like-20061028025416/ Share on other sites More sharing options...
ToonMariner Posted November 2, 2006 Share Posted November 2, 2006 Use the datatime type in your database table and use the query to make the comparisons - mysql's support for date/time manipulation/calculations is far greater than php's Link to comment https://forums.phpfreaks.com/topic/25872-just-an-if-statement-with-numbers-like-20061028025416/#findComment-118203 Share on other sites More sharing options...
karthikeyan_coder Posted November 2, 2006 Author Share Posted November 2, 2006 ohh ok... so i have to convert my script to $today = date("YmdHis");$sql = "SELECT * FROM `articles` WHERE `date`<='$today'";Thanks ToonMariner :) Link to comment https://forums.phpfreaks.com/topic/25872-just-an-if-statement-with-numbers-like-20061028025416/#findComment-118259 Share on other sites More sharing options...
karthikeyan_coder Posted November 2, 2006 Author Share Posted November 2, 2006 sorry it is $today = date("YnjHis"); Link to comment https://forums.phpfreaks.com/topic/25872-just-an-if-statement-with-numbers-like-20061028025416/#findComment-118261 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.