sammysam Posted December 26, 2010 Share Posted December 26, 2010 Hello Everybody, I'm experiencing a weird issue, most probably cause of lack of expertise or maybe I'm just missing something. I'm using the following code $sql = "INSERT INTO tags(tag,woeid,photoId, offset ) VALUES (?, ?, ?, ?)"; $id=$photo['id']; $stmt->bind_param('sssi',$tag_name,$woeid,$id,$limit); All is ok but the parameter $id. In the Mysql Table if I define $id as integer whatever value it has will be converted in 2147483647 I really don't know why! $id is actually a string so i though i could type cast before binding with $id=(int) $photo['id']; $stmt->bind_param('ssii',$tag_name,$woeid,$id,$limit); but I had no luck, still that weird value. The only thing that seems to work is updating the table letting that columns be a varchar..but I need an Integer! Is it a problem of mysqli or mysql? I think I spent 5 hours trying to figure this problem out. Any help? Thanks, bye bye Quote Link to comment https://forums.phpfreaks.com/topic/222684-mysqli-bind_param-and-type-castin-error/ Share on other sites More sharing options...
the182guy Posted December 27, 2010 Share Posted December 27, 2010 PHP's largent integer it can handle is 2147483647. Anything over that will automatically be set to that number. Do you really have over 2 billion rows in your table? Quote Link to comment https://forums.phpfreaks.com/topic/222684-mysqli-bind_param-and-type-castin-error/#findComment-1151821 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.