Php phonegap应用程序与mysql服务器的数据库连接

Php phonegap应用程序与mysql服务器的数据库连接,php,mysql,Php,Mysql,我最近刚刚使用jquery和ajax完成了我的移动应用程序,它在我的web浏览器上运行得非常好,但当我使用phone gap编译它时。但是,数据库连接不起作用 我创建了一个helper类,它包含数据库连接的所有php代码。当我运行我的应用程序时,会看到整个查询,而不是结果 请帮忙 我的助手类具有以下代码: class helper { private $con; function __construct() { $this->con= new mysqli("192.1

我最近刚刚使用jquery和ajax完成了我的移动应用程序,它在我的web浏览器上运行得非常好,但当我使用phone gap编译它时。但是,数据库连接不起作用

我创建了一个helper类,它包含数据库连接的所有php代码。当我运行我的应用程序时,会看到整个查询,而不是结果

请帮忙

我的助手类具有以下代码:

class helper
{
  private $con;
  function __construct()
  {
    $this->con= new mysqli("192.168.1.22","root","","rmoce");
  }
  function __destruct()
  {
    $this->con->close();
  }
  function insert($table,$field,$value)
  {
    $str=" insert into $table($field) values($value) ";
    $this->con->query($str) or die($this->con->error);
  }
  function delete($table,$condition)
  {
    $str= "delete from $table where $condition";
    $this->con->query($str);
  }
  function update($str)
  {
    $this->con->query($str);
  }
  function select($field,$table,$condition)
  {
    $str="select $field from $table where $condition";
$result= $this->con->query($str) or die($this->con->error);
if ($result->num_rows==0)
{
  return "no";
}
else
{
  while($row = $result->fetch_array(MYSQL_ASSOC))
{
  $data[] = $row;
}
return $data;
  }
}

$obj= new helper();

当我运行应用程序时,我看到了整个查询本身。请提供帮助。

助手类必须位于服务器上,并且您使用ajaxyup从应用程序连接到助手。我使用ajax获取数据,但是我使用我的计算机作为服务器本身,因此我在将计算机连接到wifi连接后写入了计算机的ip地址,但是我收到了相同的错误。请帮忙!!!!你能提供用于ajax连接的代码吗?很抱歉刚才看到你的消息这里是ajax的代码:抱歉这里是代码>$.ajax({type:“post”,url:“192.168.1.22//table.php),数据:“cust1=“+cust+”&osys1=“+osys+”&hset1=“+hset+”&syear=“+year+”&smonth=“+month+”&sdate=“+date+”&eyear=“+eyear+”&emonth=“+emonth+”&edate=”+edate+“&shour=“+hour+”&sminute=“+minute+”&ehour=“+ehour+”&eminute=“+eminute,success:function(response){$(“#mainright”).html(response);});