I have a mysql table with float variables. I want to pass them to mongodb collection, but when i do it, php convert my float variables into string. I've tried to use this code to set variable type as float but it returns me 1 in every field:
foreach( $mytables as $table => $struct ) {
$sql = mysql_query("SELECT num_auto FROM XL_10331_EXPLOIT_251012 where flightid like '191622'") or die( mysql_error() );
$count = mysql_num_rows( $sql );
// If it has content insert all content
if( $count > 0 ) {
while($info = mysql_fetch_row($sql)) {
$int_info=intval($info);
$mosql[]=($int_info);
}
// Starts new collection on mongodb
$collection = $modb->floatdb;
$collection->insert(array('num_auto'=>$mosql));
i can't find my mistake, any help will be really appreciated! Thanks!