i am using $_GET[‘var’] to get a variable then compare it with a variable in my database. the variable is 1.1 the var is set to “float” on the database so i know it can handle decimals but when i compare them with the code below i get nothing.
include 'connect.php';
$sql=mysql_query("SELECT * FROM table WHERE stuff='$stuff'");
while ($row=mysql_fetch_assoc($sql)) {
$start=$row['start'];
}
echo $start; //nothing happens
From what I know
floattype isn’t precise. It doesn’t show you that actual value so1.1that you saved may not be the actual value stored. Trying setting your field asdecimaland give it a length of say,10,1where 10 is the maximum number of digits (the precision) and 1 is the number of digits to the right of the decimal point (the scale). It should work doing query likestuff='1.1'orstuff=1.1.