zend amf无法返回MySQL数据库的big-int?
好吧,这是我的查询,它工作正常,并且字段friend_id的类型为MySQL big-int
“SELECTfriend_idFROMusers_friendsufWHEREuf.user_id=1192134553limit2”
并且查询返回所需的结果,即 100002407532395 , 100002307531370
现在这是我的服务 zend/amf 服务
public function GetUserAllFreinds($user_id)
{
$sql = "SELECT friend_id FROM users_friends uf WHERE uf.user_id=$user_id limit 2";
$res = mysql_query($sql) or die(debug($sql).mysql_error());
return $res;
}
并且该服务返回我 2147483647。但是,当我将friend_id 设置为 MySQL varchar 时,它可以工作。为什么它不适用于大整型?
Well here is my query and and it works fine and the field friend_id is of type MySQL big-int
"SELECT friend_id FROM users_friends uf WHERE uf.user_id=1192134553 limit 2"
and the query returns the required result i.e
100002407532395 ,
100002307531370
now here is my service zend/amf service
public function GetUserAllFreinds($user_id)
{
$sql = "SELECT friend_id FROM users_friends uf WHERE uf.user_id=$user_id limit 2";
$res = mysql_query($sql) or die(debug($sql).mysql_error());
return $res;
}
And the service returns me 2147483647. However when i set friend_id to MySQL varchar, it works. why it does not work for big-int??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试将注释放在服务方法之前,如下所示:
另外,您的代码正在返回 mysql_query 的结果。返回结果之前不应该对其进行处理吗?
然后,返回 $values,将 @return 设置为 array 而不是 int。
Try putting the annotations before the service method, as follows:
Also, your code is returning the result of mysql_query. Shouldn't process the result before returning it?
and then, returning the $values, setting @return to array instead of int.