Skip to content

Instantly share code, notes, and snippets.

View ziedrebhi's full-sized avatar
🎯
Focusing

Zied Rebhi ziedrebhi

🎯
Focusing
View GitHub Profile
<?php
/*
* Following code will create a new product row
* All product details are read from HTTP Post Request
*/
// array for JSON response
$response = array();
<?php
// array for JSON response
$response = array();
// include db connect class
require_once __DIR__ . '/db_connect.php';
// connecting to db
<?php
/*
* Following code will list all the categories
*/
// array for JSON response
$response = array();
<?php
/**
* A class file to connect to database
*/
class DB_CONNECT {
var $myconn;
/**
* Function to connect with database
<?php
/*
* Following code will list all the products
*/
// array for JSON response
$response = array();
<?php
/*
* Following code will get single product details
* A product is identified by product id (id)
*/
// array for JSON response
$response = array();
<?php
/*
* All database connection variables
*/
define('DB_USER', "root"); // db user
define('DB_PASSWORD', ""); // db password (mention your db password here)
define('DB_DATABASE', "foodapp_db"); // database name
define('DB_SERVER', "localhost"); // db server
CREATE TABLE IF NOT EXISTS `categories` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name_cat` varchar(255) NOT NULL,
`image_cat` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;
--
-- Contenu de la table `categories`
<uses-permission android:name="android.permission.VIBRATE" />
private final void ajouterNotification() {
// Récupération du notification Manager
final NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
// Récupération du titre et description de la notification
final String notificationTitle = "Ma notification";
final String notificationDesc = "Cliquez ici , je suis une notification";
// Création de la notification avec spécification de l'icône de la