Welcome Guest, Not a member yet? Register   Sign In
To find values between two fields of varchar
#1

[eluser]quest13[/eluser]
Hi,Though this problem is of generic in nature,It will be grateful if someone from CI forum can help me out as I am currently doing an application using CI and halted awkwardly due to a minor issue.

I have a situation where I have to allow the user to enter the field value 'Size' as varchar,( eg. 2.3 acre etc).But I have a requirement to filter the size values between certain range ( for ex. between 1.2 acre to 3.5 acre )out of the values stored in the DB.I know it is basically about Sql query ,but I'm not getting a correct solution to this and any help in this regard will be really helpful to me.

Thanks
#2

[eluser]InsiteFX[/eluser]
Hi,

This is from the PHP manual, it sould point you in the right direction.

Code:
float floatval  ( mixed $var  ) - Gets the float value of a string.
<?php
$var = '122.34343The';
$float_value_of_var = floatval($var);
echo $float_value_of_var; // 122.34343
?>

Enjoy
InsiteFX
#3

[eluser]quest13[/eluser]
It is really great ! Thanks a lot for your immediate response.




Theme © iAndrew 2016 - Forum software by © MyBB