Esempio n. 1
0
<?php

/* Connexion */
include '../connection/connection.php';
$json = file_get_contents_utf8('php://input');
$obj = json_decode($json);
//var_dump($obj);
$sql = 'UPDATE `owner` SET 
                                `owner_name`="' . encodeToDB($obj->{'owner_name'}) . '",
                                `owner_description`="' . encodeToDB($obj->{'owner_description'}) . '",
                                `active`="' . $obj->{'active'} . '" 
            WHERE `owner_id`="' . $obj->{'owner_id'} . '"';
//print $sql;
if (mysqli_query($con, $sql)) {
    echo "success";
} else {
    echo "Error: " . $sql . "<br>" . mysqli_error($con);
}
mysqli_close($con);
Esempio n. 2
0
<?php

/* Connexion */
include '../connection/connection.php';
$json = file_get_contents_utf8('php://input');
$obj = json_decode($json);
//var_dump($obj);
$sql = 'UPDATE `category` SET 
                                `category_name`="' . encodeToDB($obj->{'category_name'}) . '",
                                `category_description`="' . encodeToDB($obj->{'category_description'}) . '",
                                `active`="' . $obj->{'active'} . '" 
            WHERE `category_id`="' . $obj->{'category_id'} . '"';
//print $sql;
if (mysqli_query($con, $sql)) {
    echo "success";
} else {
    echo "Error: " . $sql . "<br>" . mysqli_error($con);
}
mysqli_close($con);
Esempio n. 3
0
<?php

/* Connexion */
include '../connection/connection.php';
$json = file_get_contents_utf8('php://input');
$obj = json_decode($json);
//var_dump($obj);
$sql = 'INSERT INTO `link`
                            (`link_id`, `link_name`, `link_link`, `link_owner_id`, `active`) VALUES 
                                (null, "' . encodeToDB($obj->{'link_name'}) . '", "' . encodeToDB($obj->{'link_link'}) . '", ' . $obj->{'link_owner_id'} . ', "' . $obj->{'active'} . '")';
//print $sql;
if (mysqli_query($con, $sql)) {
    echo "success";
} else {
    echo "Error: " . $sql . "<br>" . mysqli_error($con);
}
mysqli_close($con);
Esempio n. 4
0
<?php

/* Connexion */
include '../connection/connection.php';
$json = file_get_contents_utf8('php://input');
$obj = json_decode($json);
//var_dump($obj);
$sql = 'INSERT INTO `photo`
                            (`photo_id`, `photo_name`, `photo_description`, `photo_date`, `photo_link`, `photo_mini_link`, `appareil`, `obturation`, `ouverture`, `longueur_focale`, `vitesse_ISO`, `category_photo`, `active`) VALUES 
                            (null, "' . encodeToDB($obj->{'photo_name'}) . '", "' . encodeToDB($obj->{'photo_description'}) . '", "' . $obj->{'photo_date'} . '", "' . encodeToDB($obj->{'photo_link'}) . '", "' . encodeToDB($obj->{'photo_mini_link'}) . '", "' . encodeToDB($obj->{'appareil'}) . '", "' . encodeToDB($obj->{'obturation'}) . '", "' . encodeToDB($obj->{'ouverture'}) . '", "' . encodeToDB($obj->{'longueur_focale'}) . '", "' . encodeToDB($obj->{'vitesse_ISO'}) . '", ' . $obj->{'category_photo'} . ', "' . $obj->{'active'} . '")';
//print $sql;
if (mysqli_query($con, $sql)) {
    echo "success";
} else {
    echo "Error: " . $sql . "<br>" . mysqli_error($con);
}
mysqli_close($con);
Esempio n. 5
0
<?php

/* Connexion */
include '../connection/connection.php';
$json = file_get_contents_utf8('php://input');
$obj = json_decode($json);
//var_dump($obj);
$sql = 'INSERT INTO `owner`
                            (`owner_id`, `owner_name`, `owner_description`, `active`) VALUES 
                                (null, "' . encodeToDB($obj->{'owner_name'}) . '", "' . encodeToDB($obj->{'owner_description'}) . '", "' . $obj->{'active'} . '")';
//print $sql;
if (mysqli_query($con, $sql)) {
    echo "success";
} else {
    echo "Error: " . $sql . "<br>" . mysqli_error($con);
}
mysqli_close($con);
Esempio n. 6
0
<?php

/* Connexion */
include '../connection/connection.php';
$json = file_get_contents_utf8('php://input');
$obj = json_decode($json);
//var_dump($obj);
$sql = 'UPDATE `link` SET 
                                `link_name`="' . encodeToDB($obj->{'link_name'}) . '",
                                `link_link`="' . encodeToDB($obj->{'link_link'}) . '",
                                `link_owner_id`="' . $obj->{'link_owner_id'} . '",
                                `active`="' . $obj->{'active'} . '" 
            WHERE `link_id`="' . $obj->{'link_id'} . '"';
//print $sql;
if (mysqli_query($con, $sql)) {
    echo "success";
} else {
    echo "Error: " . $sql . "<br>" . mysqli_error($con);
}
mysqli_close($con);
Esempio n. 7
0
<?php

/* Connexion */
include '../connection/connection.php';
$json = file_get_contents_utf8('php://input');
$obj = json_decode($json);
//var_dump($obj);
$sql = 'UPDATE `photo` SET 
                                `photo_name`="' . encodeToDB($obj->{'photo_name'}) . '",
                                `photo_description`="' . encodeToDB($obj->{'photo_description'}) . '",
                                `photo_link`="' . encodeToDB($obj->{'photo_link'}) . '",
                                `photo_mini_link`="' . encodeToDB($obj->{'photo_mini_link'}) . '",
                                `appareil`="' . encodeToDB($obj->{'appareil'}) . '",
                                `obturation`="' . encodeToDB($obj->{'obturation'}) . '",
                                `ouverture`="' . encodeToDB($obj->{'ouverture'}) . '",
                                `longueur_focale`="' . encodeToDB($obj->{'longueur_focale'}) . '",
                                `vitesse_ISO`="' . encodeToDB($obj->{'vitesse_ISO'}) . '",
                                `category_photo`="' . $obj->{'category_photo'} . '",
                                `active`="' . $obj->{'active'} . '" 
            WHERE `photo_id`="' . $obj->{'photo_id'} . '"';
//print $sql;
if (mysqli_query($con, $sql)) {
    echo "success";
} else {
    echo "Error: " . $sql . "<br>" . mysqli_error($con);
}
mysqli_close($con);
Esempio n. 8
0
<?php

/* Connexion */
include '../connection/connection.php';
$json = file_get_contents_utf8('php://input');
$obj = json_decode($json);
//var_dump($obj);
$sql = 'INSERT INTO `category`
                                (`category_id`, `category_name`, `category_description`, `category_date`, `active`) VALUES 
                                    (null, "' . encodeToDB($obj->{'category_name'}) . '", "' . encodeToDB($obj->{'category_description'}) . '", "' . $obj->{'category_date'} . '", "' . $obj->{'active'} . '")';
//print $sql;
if (mysqli_query($con, $sql)) {
    echo "success";
} else {
    echo "Error: " . $sql . "<br>" . mysqli_error($con);
}
mysqli_close($con);