- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Guys, please help me!
I have a generic class with CRUD in PHP, I would like to use it with the Intel XDK. But I do not know how to call the methods of that class.
The CRUD methods take an array with data and a string stating the DB table as parameters, eg:
class CRUD_Generico {
/ * ------------------------------------------------ -
* CRUD_Generico.php
* INSERT NEW ITEM ON THE TABLE
*author: Vieira - Belo Horizonte-MG
* ------------------------------------------------- -* /
public function getAllDados ($ table, $ where) {
$ db = $ this-> connection ();
$ query = "SELECT * FROM $ table";
if ($ where! = "") {
$ query = $ where.;
}// Does the query on the table and returns an object;
// ------------------------------------------------ -
return $ object;}
public function addItem ($ table, $ data) {
$ db = $ this-> connection ();// Does the inclusion in the table and returns an "OK";
// ------------------------------------------------ -return "OK";
}}
How to use this class in Intel XDK?
Can someone help me?
Abs.
Pessoal, me ajude por favor!
Tenho uma classe genérica com CRUD em PHP, gostaria de utilizá-la com o Intel XDK. Porém não sei como fazer a chama dos métodos dessa classe.
Os métodos CRUD recebem um array com os dados e uma string informando a tabela do BD como parâmetros, exemplo:
class CRUD_Generico {
/* --------------------------------------------------
* CRUD_Generico.php
* INSERIR NOVO ITEM NA TABELA
* @author: Vieira - Belo Horizonte -MG
* --------------------------------------------------
*/
public function getAllDados($tabela, $where){
$db = $this->connection();
$consulta = "SELECT * FROM $tabela ";
if ($where !="") {
$consulta .= $where;
}
// Faz a consulta na tabela e retorna um objeto;
//-------------------------------------------------
return $objeto;
}
public function addItem($tabela, $dados) {
$db = $this->connection();
// Faz a inserção na tabela e retorna um "OK";
//-------------------------------------------------
return "OK";
}
}
Como utilizar essa classe no Intel XDK?
Alguém pode me ajudar?
Abs.
- Tags:
- HTML5
- Intel® XDK
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your PHP code would be running on server and Intel XDK creates client side app. So, what you need to do is :
1) On server side create a webservice using PHP that can serve a GET or POST request
2) Use AJAX within your XDK app to get data from your webservice.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page