mysql — Restful Web Service не получает никаких данных с живого сервера Переполнение стека

Я создал restful веб-сервисов в php, чтобы связать данные с приложением.
В моем локальном хосте я получаю все, но я не получаю никакого вывода в Godaddy Server.

<?php
require_once("Rest.inc.php");

class API extends REST {
public $data = "";
const DB_SERVER = "localhost";
const DB_USER = "root";
const DB_PASSWORD = "";
const DB = "beta01";
private $db = NULL;
public function __construct(){
parent::__construct();
$this->dbConnect();
}
private function dbConnect(){
$this->db = mysql_connect(self::DB_SERVER,self::DB_USER,self::DB_PASSWORD);
if($this->db)
mysql_select_db(self::DB,$this->db);
}
public function processApi(){
$func = strtolower(trim(str_replace("/","",$_REQUEST['rquest'])));
if((int)method_exists($this,$func) > 0)
$this->$func();
else
$this->response('',404);
}

private function users(){

if($this->get_request_method() != "GET"){
$this->response('',406);
}
$sql = mysql_query("SELECT * FROM users", $this->db);
if(mysql_num_rows($sql) > 0){
$result = array();
while($rlt = mysql_fetch_array($sql,MYSQL_ASSOC)){
$result[] = $rlt;
}

$this->response($this->json($result), 200);
}
$this->response('',204);
}

0

Решение

Задача ещё не решена.

Другие решения

Других решений пока нет …

По вопросам рекламы [email protected]