This topic is locked

Import large number

12/22/2016 10:01:02 PM
PHPRunner General questions
M
macalister author

Hi.
I have a xlsx with a column that store a number, the import works fine, but i have an event BeforeImport like that:



$sql = "select * from table where bigvalue = '".$rawvalues["bignumber"]."'";

$rsExistsData = db_query($strData ,$conn);

$data = db_fetch_array($rsExistsData );
if($data){

do something;

}


but i realized that the select not found nothing, then i did a test setting a message log:



$message = $rawvalues["bignumber"];

return false;



the imported value is 769201650040066 and it is stored correctly but when i get the $rawvalue is 7.6920165004025E+14 and the condition based in the query fails.
My question is how to take the correct value?
Thanks !
PS:I'm using phprunner 8.1

admin 12/24/2016

I would give it a try with the latest version of PHPRunner and if this issue is still there feel free to post your project to Demo Account and contact support directly sending your sample import Excel file for investigation.

lefty 12/27/2016



I would give it a try with the latest version of PHPRunner and if this issue is still there feel free to post your project to Demo Account and contact support directly sending your sample import Excel file for investigation.


You have big number in xlsx file column formatted as number and database formatted as integer in which your query is text ( take out ' quotes ' ) . OR change entire structure to text.
$sql = "select from table where bigvalue = '";
change to

$sql = "select
from table where bigvalue = ".$rawvalues["bignumber"]."";
It's basically ' type mismatch '

Iv'e run into this in the past . That is what fixed my issue.