我想要做的是我在数据库中有条目存储lat/long.我想计算用户lat/long和条目lat/long(在DB中)之间的距离.在那之后,我想回应距离小于500米的那些.到目前为止,我能够使用它foreach.
<?php
mysql_connect("localhost", "beepbee_kunwarh", "kunwar") or die('MySQL Error.');
mysql_select_db("beepbee_demotest") or die('MySQL Error.');
$Lat = $_REQUEST['Lat'];
$long = $_REQUEST['long'];
$query = mysql_query("SELECT a.*, 3956 * 2 * ASIN(SQRT( POWER(SIN(($Lat - Lat) * pi()/180 / 2), 2) + COS($Lat * pi()/180) * COS(Lat * pi()/180) *POWER(SIN(($long - long) * pi()/180 / 2), 2) )) as distance FROM userResponse GROUP BY beepid HAVING distance <= 500 ORDER by distance ASC;");
$data = array();
while ($row = mysql_fetch_array($query)) {
$data[] = $row; …Run Code Online (Sandbox Code Playgroud) 我正在我的两个控制器上购买应用程序,例如view1,view2.
当我在view1中购买消费品时,一切正常.
但是当我在事务完成后在view2上购买另一个可消耗产品时,它会触发我在view1上发出的旧请求而不是新的view2请求.反之亦然
另外,如果我在重建之后从同一个控制器重新生成相同的产品,那么它就是我之前做出的请求......
Example:
Controller1:
product1 > buy > someaction(say hit to the server with some params like "name= ABC")
user enters name and is dynamic
Again,
if I rebuy it
product1 > buy > someaction(say hit to the server with some params like "name= XYZ")
Now when product is bought it hits the server with old params "name=ABC" and not "name=XYZ" what user enters again..
Run Code Online (Sandbox Code Playgroud)
产品
**heres the code m using in my IAPhelper**
- (id)initWithProductIdentifiers:(NSSet *)productIdentifiers { …Run Code Online (Sandbox Code Playgroud)