babyfreak Posted July 1, 2010 Share Posted July 1, 2010 Hey all, Here is my code, but the data I get from the db are string $mydb = new PDO('mysql:host=localhost;dbname=mybase', 'root', ''); $mydb->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, false); //DOESN'T WORK I've read it's a question of mysql VS mysqlnd that I don't quite understand. I'm using WampServer2 with mysql 5.1.36 I upgratted to mysql5.1.41 - not working better. (mysql bug identified in http://bugs.php.net/bug.php?id=44341 If anyone can help... Quote Link to comment https://forums.phpfreaks.com/topic/206388-getting-string-instead-of-int-wampserver2/ Share on other sites More sharing options...
AbraCadaver Posted July 1, 2010 Share Posted July 1, 2010 MySQL always returns strings, so cast the value to an int when you use it. Quote Link to comment https://forums.phpfreaks.com/topic/206388-getting-string-instead-of-int-wampserver2/#findComment-1079857 Share on other sites More sharing options...
babyfreak Posted July 2, 2010 Author Share Posted July 2, 2010 ok ... I thought there was some news with mysqlnd but I can't find figure out how it works so ... I suppose I'll finally cast the data. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/206388-getting-string-instead-of-int-wampserver2/#findComment-1080112 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.