I am trying to run a select statement on a table for a column. The column is decimal(20,0) unsigned.
A majority of the entries can be found using the select statement:
db_query('SELECT * FROM {foo_table} WHERE foo_id = :other_id',array(':other_id' => $value))
and $value is a string holding a large number, and example number is 395589699550470144
I believe that query is treating the $value as a string for some of the larger numbers. Now this query works.
db_query("SELECT * FROM {foo_table} WHERE foo_id = $value")
But this query is insecure due to user input method.
Is there a way to force the query to always convert the string to a number safely?