本文整理汇总了PHP中MySQL::SQLValue方法的典型用法代码示例。如果您正苦于以下问题:PHP MySQL::SQLValue方法的具体用法?PHP MySQL::SQLValue怎么用?PHP MySQL::SQLValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MySQL
的用法示例。
在下文中一共展示了MySQL::SQLValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: insertKiiconnect
function insertKiiconnect()
{
global $databaseKiiconnect;
$data = json_decode(stripslashes($_POST["data"]));
$update["nombre"] = MySQL::SQLValue($data->nombre);
$update["tag"] = MySQL::SQLValue($data->tag);
$update["descripcion"] = MySQL::SQLValue($data->descripcion);
$update["icono"] = MySQL::SQLValue($data->icono);
$update["link"] = MySQL::SQLValue($data->link);
$update["orden"] = MySQL::SQLValue($data->orden);
$update["id_categoria"] = MySQL::SQLValue($data->id_categoria);
$update["activo"] = MySQL::SQLValue($data->activo, MySQL::SQLVALUE_NUMBER);
$databaseKiiconnect->InsertRow("kiiconnect_setting", $update);
echo json_encode(array("success" => $databaseKiiconnect->ErrorNumber() == 0, "msg" => $databaseKiiconnect->ErrorNumber() == 0 ? "Parametro insertado exitosamente" : $databaseKiiconnect->ErrorNumber(), "data" => array(array("id" => $databaseKiiconnect->GetLastInsertID(), "nombre" => $data->nombre, "tag" => $data->tag, "descripcion" => $data->descripcion, "icono" => $data->icono, "link" => $data->link, "orden" => $data->orden, "id_categoria" => $data->id_categoria, "activo" => $data->activo))));
//inserto como blob la imagen
$file = __DIR__ . '/../../../../' . $data->icono;
if ($fp = fopen($file, "rb", 0)) {
$picture = fread($fp, filesize($file));
fclose($fp);
// base64 encode the binary data, then break it
// into chunks according to RFC 2045 semantics
$base64 = chunk_split(base64_encode($picture));
$tag = 'data:image/png;base64,' . $base64;
}
$lastId = $databaseKiiconnect->GetLastInsertID();
$databaseKiiconnect->Query("update kiiconnect_setting set file='{$tag}' where `id`='{$lastId}'");
}
示例2: creat
public static function creat()
{
global $db;
$values["token"] = MySQL::SQLValue(md5(uniqid(rand(), true)));
$result = $db->InsertRow("token", $values);
return TRUE;
}
示例3: edituser
function edituser($id, $fnom, $lnom, $pass, $pseudo, $service, $agence, $tel, $email)
{
global $db;
if ($pass != NULL) {
$values["pass"] = MySQL::SQLValue(md5($pass));
}
$values["fnom"] = MySQL::SQLValue($fnom);
$values["nom"] = MySQL::SQLValue($pseudo);
$values["servic"] = MySQL::SQLValue($service);
$values["agence"] = MySQL::SQLValue($agence);
$values["fnom"] = MySQL::SQLValue($fnom);
$values["lnom"] = MySQL::SQLValue($lnom);
$values["mail"] = MySQL::SQLValue($email);
$values["tel"] = MySQL::SQLValue($tel);
$where["id"] = MySQL::SQLValue($id);
// Execute the insert
$result = $db->UpdateRows("users_sys", $values, $where);
// ajout champs table synchrone
$sql = $db->BuildSQLUpdate("users_sys", $values, $where);
$valuesf["req"] = MySQL::SQLValue($sql);
$r = $db->InsertRow("temprequet", $valuesf);
// If we have an error
if (!$result) {
// Show the error and kill the script
$db->Kill($result);
return false;
} else {
return true;
}
}
示例4: get_option
/** Lấy dữ liệu */
function get_option($args = array())
{
if (!is_array($args)) {
parse_str($args, $args);
}
global $hmdb;
if (isset($args['section'])) {
$section = $args['section'];
} else {
$section = '';
}
if (isset($args['key'])) {
$key = $args['key'];
} else {
$key = '';
}
if (isset($args['default_value'])) {
$default_value = $args['default_value'];
} else {
$default_value = '';
}
if ($section != '' and $key != '') {
$tableName = DB_PREFIX . 'option';
$whereArray = array('section' => MySQL::SQLValue($section), 'key' => MySQL::SQLValue($key));
$hmdb->SelectRows($tableName, $whereArray);
if ($hmdb->HasRecords()) {
$row = $hmdb->Row();
return $row->value;
} else {
return $default_value;
}
} else {
return FALSE;
}
}
示例5: setcollecte
function setcollecte($id, $mode_paiement, $pj, $date_paiement)
{
global $db;
//$nextid=getnextidtable('collecte');
$date = date('Y-m-d-', strtotime($date_paiement));
$values["mode_paiement"] = MySQL::SQLValue($mode_paiement);
$values["date_paiement"] = MySQL::SQLValue($date);
$values["etat_paiement"] = MySQL::SQLValue("Payé");
$where["id"] = MySQL::SQLValue($id);
if (!$db->UpdateRows("collecte", $values, $where)) {
$db->Kill($db->Error());
return false;
} else {
$sql = $db->BuildSQLInsert("collecte", $values);
logg('Enregistrement collecte ', 195, $id, $_SESSION['userid']);
if ($pj != "") {
$basedir = "upload/collecte";
if (!file_exists($basedir)) {
mkdir($basedir, 0, true);
}
$newdir = $basedir . "/";
copyfile($pj, $id, $newdir, "Attachement_collecte_");
autoarchive($newdir . changnom($pj, $id, 'Attachement_collecte_'), "Fichier joint collecte {$id}", 195, $id, "collecte", "piece_jointe", $_SESSION['userid'], cryptage(session::get('service'), 0));
}
return true;
}
}
示例6: addaemploi
function addaemploi($id_aemploi, $montant, $date_paiement, $mode_paiement, $ref_pj, $pj)
{
global $db;
$nextid = getnextidtable('autorisation_emploi');
$usrid = $_SESSION['userid'];
$date = date('Y-m-d-', strtotime($date_paiement));
$values["pj"] = MySQL::SQLValue($pj);
$values["ref_pj"] = MySQL::SQLValue($ref_pj);
$values["id_aemploi"] = MySQL::SQLValue($id_aemploi);
$values["mode_paiement"] = MySQL::SQLValue($mode_paiement);
$values["date_paiement"] = MySQL::SQLValue($date);
$values["montant"] = MySQL::SQLValue($montant);
$values["addby"] = MySQL::SQLValue($usrid);
if (!$db->InsertRow("autorisation_emploi", $values)) {
$db->Kill($db->Error());
return false;
} else {
$sql = $db->BuildSQLInsert("autorisation_emploi", $values);
logg('Enregistrement Autorisation Emploi ', 246, $nextid, $_SESSION['userid']);
if ($pj != "") {
$basedir = "upload/Autorisation";
if (!file_exists($basedir)) {
mkdir($basedir, 0, true);
}
$newdir = $basedir . "/";
copyfile($pj, $nextid, $newdir, "Attachement_autorisation_");
autoarchive($newdir . changnom($pj, $nextid, 'Attachement_autorisation_'), "Fichier joint autorisation emploi {$nextid}", 246, $nextid, "autorisation_emploi", "pj", $_SESSION['userid'], cryptage(session::get('service'), 0));
}
}
return true;
}
示例7: get_uri_data
return FALSE;
}
}
function get_uri_data($args)
{
$hmdb = new MySQL(true, DB_NAME, DB_HOST, DB_USER, DB_PASSWORD, DB_CHARSET);
if (!is_array($args)) {
parse_str($args, $args);
}
if (isset($args['uri'])) {
$uri = $args['uri'];
} else {
$uri = FALSE;
}
if (isset($args['id'])) {
$id_uri = $args['id'];
} else {
$id_uri = FALSE;
}
$tableName = DB_PREFIX . "request_uri";
if (is_numeric($id_uri)) {
$whereArray = array('id' => MySQL::SQLValue($id_uri));
} else {
$whereArray = array('uri' => MySQL::SQLValue($uri));
}
$hmdb->SelectRows($tableName, $whereArray);
if ($hmdb->HasRecords()) {
$row = $hmdb->Row();
return $row;
} else {
示例8: editnote
function editnote($objet, $note, $id, $dat)
{
global $db;
$date = date('Y-m-d', strtotime($dat));
$getan = date('Y', strtotime($dat));
$usrid = $_SESSION['userid'];
$values["objet"] = MySQL::SQLValue($objet);
$values["dat"] = MySQL::SQLValue($date);
$where["id"] = MySQL::SQLValue($id);
// Execute the insert
$result = $db->UpdateRows("noteservice", $values, $where);
// ajout champs table synchrone
$sql = $db->BuildSQLUpdate("noteservice", $values, $where);
$valuesf["req"] = MySQL::SQLValue($sql);
$r = $db->InsertRow("temprequet", $valuesf);
// If we have an error
if (!$result) {
// Show the error and kill the script
$db->Kill('Error Update');
return false;
} else {
logg('Modification Note de service', 12, $id, $_SESSION['userid']);
$basedir = "upload/noteservice/{$getan}";
// save file
if (!file_exists($basedir)) {
mkdir($basedir, 0, true);
}
$newdir = $basedir . "/";
if ($note != "") {
copyfile($note, $id, $newdir, "note_");
//autoarchive($newdir.changnom($note,$id,'note_'),"Note de service N° $id ",12,$id,"noteservice", "file", $_SESSION['userid'],cryptage(session::get('service'),0));
}
return true;
}
}
示例9: addevent
function addevent($titrfr, $titren, $titrar, $contfr, $conten, $contar, $img, $id, $autfr, $auten, $autar, $dat)
{
global $db;
$date = date('Y-m-d-', strtotime($dat));
$values["titrfr"] = MySQL::SQLValue($titrfr);
$values["titren"] = MySQL::SQLValue($titren);
$values["titrar"] = MySQL::SQLValue($titrar);
$values["contfr"] = MySQL::SQLValue($contfr);
$values["conten"] = MySQL::SQLValue($conten);
$values["contar"] = MySQL::SQLValue($contar);
$values["autfr"] = MySQL::SQLValue($autfr);
$values["auten"] = MySQL::SQLValue($auten);
$values["autar"] = MySQL::SQLValue($autar);
$values["app"] = MySQL::SQLValue('?_tsk=event&id=' . $id);
$values["dat"] = MySQL::SQLValue($date);
// Execute the insert
$result = $db->InsertRow("event", $values);
// If we have an error
if (!$result) {
// Show the error and kill the script
$db->Kill('Error Insert');
return false;
} else {
if ($img != "") {
$basedir = "upload/event";
if (!file_exists($basedir)) {
mkdir($basedir, 0, true);
}
$newdir = "../upload/event/";
copyfile($img, $id, $newdir, "event_");
autoarchive($newdir . changnom($img, $id, 'event_'), "Image Evénement {$id} ", 12, $id, "event", "img", $_SESSION['userid'], cryptage(session::get('service'), 0));
}
return true;
}
}
示例10: add_contrat
function add_contrat($nextid, $titre, $fournisseur, $date, $montant_global, $article, $paragraphe, $chapitre, $pj)
{
global $db;
$usrid = $_SESSION['userid'];
$date = date('Y-m-d-', strtotime($date));
$values["titre"] = MySQL::SQLValue($titre);
$values["date"] = MySQL::SQLValue($date);
$values["id_fournisseur"] = MySQL::SQLValue($fournisseur);
$values["id_chapitre"] = MySQL::SQLValue($chapitre);
$values["id_article"] = MySQL::SQLValue($article);
$values["id_paragraphe"] = MySQL::SQLValue($paragraphe);
$values["montant_global"] = MySQL::SQLValue($montant_global);
$values["montant_paye"] = MySQL::SQLValue(0);
$values["pourcentage"] = MySQL::SQLValue(0);
$values["montant_rest"] = MySQL::SQLValue($montant_global);
$values["addby"] = MySQL::SQLValue($usrid);
if (!$db->InsertRow("contrat", $values)) {
$db->Kill($db->Error());
return false;
} else {
logg('Enregistrement Contrat Fournisseur ', 254, $nextid, $_SESSION['userid']);
// Save PJ to archive
if ($pj != "") {
$basedir = "upload/contrat";
if (!file_exists($basedir)) {
mkdir($basedir, 0, true);
}
$newdir = $basedir . "/";
copyfile($pj, $nextid, $newdir, "Attachement_contrat_");
autoarchive($newdir . changnom($pj, $nextid, 'Attachement_contrat_'), "Fichier joint contrat fournisseur {$nextid}", 254, $nextid, "contrat", "pj", $_SESSION['userid'], cryptage(session::get('service'), 0));
}
}
return true;
}
示例11: editdoc
function editdoc($titrfr, $titren, $titrar, $img, $id, $art, $typ)
{
global $db;
$values["titrfr"] = MySQL::SQLValue($titrfr);
$values["titren"] = MySQL::SQLValue($titren);
$values["titrar"] = MySQL::SQLValue($titrar);
$values["article"] = MySQL::SQLValue($art);
$values["typ"] = MySQL::SQLValue($typ);
if ($img != "") {
$values["img"] = MySQL::SQLValue(changnom($img, $id, 'doc_'));
}
$where["id"] = MySQL::SQLValue($id);
// Execute the insert
$result = $db->UpdateRows("document", $values, $where);
// If we have an error
if (!$result) {
// Show the error and kill the script
$db->Kill('Error Update');
return false;
} else {
if ($img != "") {
$olddir = "upload/doc/";
$newdir = "../upload/doc/";
copyfile($img, $id, $newdir, "doc_");
autoarchive($newdir . changnom($img, $id, 'doc_'), "Document page {$id} ", 12, $id, "document", "img", $_SESSION['userid'], cryptage(session::get('service'), 0));
}
return true;
}
}
示例12: editalbum
function editalbum($titrfr, $titren, $titrar, $img, $id)
{
global $db;
$values["titrfr"] = MySQL::SQLValue($titrfr);
$values["titren"] = MySQL::SQLValue($titren);
$values["titrar"] = MySQL::SQLValue($titrar);
if ($img != "") {
$values["album"] = MySQL::SQLValue(changnom($img, $id, "album_"));
}
$where["id"] = MySQL::SQLValue($id);
// Execute the insert
$result = $db->UpdateRows("album", $values, $where);
// If we have an error
if (!$result) {
// Show the error and kill the script
$db->Kill($result);
return false;
} else {
if ($img != "") {
$olddir = "upload/album/";
$newdir = "../upload/album/" . $id . "/";
copyfile($img, $id, $olddir, "album_");
clearDir($newdir);
extractzip($olddir, "album_" . $id . ".zip", $id, $newdir);
}
return true;
}
}
示例13: editcollecte
function editcollecte($idcontrat, $paiement, $date, $pj)
{
global $db;
$usrid = $_SESSION['userid'];
$nextid = getnextidtable('collecte');
//$date1=date_create($date);
//$datep=date_format($date1,"Y-m-d");
$date_paiement = date('Y-m-d-', strtotime($date));
$values["mode_paiement"] = MySQL::SQLValue($paiement);
$values["date_paiement"] = MySQL::SQLValue($date_paiement);
$where["id"] = MySQL::SQLValue($idcontrat);
if (!$db->UpdateRows("collecte", $values, $where)) {
$db->Kill($db->Error());
return false;
} else {
$sql = $db->BuildSQLInsert("collecte", $values);
logg('Enregistrement collecte ', 201, $nextid, $_SESSION['userid']);
if ($pj != "") {
$basedir = "upload/collecte";
if (!file_exists($basedir)) {
mkdir($basedir, 0, true);
}
$newdir = $basedir . "/";
copyfile($pj, $nextid, $newdir, "collecte");
autoarchive($newdir . changnom($pj, $nextid, 'collecte'), "Fichier joint collecte {$nextid}", 201, $nextid, "collecte", "piece_jointe", $_SESSION['userid'], cryptage(session::get('service'), 0));
}
return true;
}
}
示例14: setcontrat
function setcontrat($id, $date, $pj)
{
global $db;
$etat = "Résilié";
$nextid = getnextidtable('contrat_location_villa');
$date = date('Y-m-d-', strtotime($date));
$values["date_resiliation"] = MySQL::SQLValue($date);
$values["etat"] = MySQL::SQLValue($etat);
$where["id"] = MySQL::SQLValue($id);
if (!$db->UpdateRows("contrat_location_villa", $values, $where)) {
$db->Kill($db->Error());
return false;
} else {
$sql = $db->BuildSQLInsert("contrat_location_villa", $values);
logg('Enregistrement Location Villa ', 233, $id, $_SESSION['userid']);
if ($pj != "") {
$basedir = "upload/location";
if (!file_exists($basedir)) {
mkdir($basedir, 0, true);
}
$newdir = $basedir . "/";
copyfile($pj, $id, $newdir, "Attachement_location_");
autoarchive($newdir . changnom($pj, $id, 'Attachement_location_'), "Fichier joint location ville {$id}", 233, $id, "contrat_location_villa", "pj_resiliation", $_SESSION['userid'], cryptage(session::get('service'), 0));
}
return true;
}
}
示例15: addsalarie2
function addsalarie2($nextid, $salarie, $nom_banque, $num_compte, $taux_anc, $iden_eau_elec, $indem_domec, $nouveau_salaire, $idem_log, $indem_caisse, $indem_risque, $indem_resp, $indem_tel)
{
global $db2;
$usrid = $_SESSION['userid'];
$indem_total = $idem_log + $indem_caisse + $indem_risque + $indem_resp + $indem_tel + $indem_domec + $iden_eau_elec;
$indem_total = $idem_log + $indem_caisse + $indem_risque + $indem_resp + $indem_tel + $indem_domec + $iden_eau_elec;
$values["nom_banque"] = MySQL::SQLValue($nom_banque);
$values["numero_compte"] = MySQL::SQLValue($num_compte);
$values["taux_anciennete"] = MySQL::SQLValue($taux_anc);
$values["salaire_de_base"] = MySQL::SQLValue($salarie);
$values["nouveau_salaire"] = MySQL::SQLValue($nouveau_salaire);
$values["indem_logement"] = MySQL::SQLValue($idem_log);
$values["indem_caisse"] = MySQL::SQLValue($indem_caisse);
$values["indem_risque"] = MySQL::SQLValue($indem_risque);
$values["indem_responsabilite"] = MySQL::SQLValue($indem_resp);
$values["idem_telephone"] = MySQL::SQLValue($indem_tel);
$values["indem_domisticite"] = MySQL::SQLValue($indem_domec);
$values["idem_eau_electrique"] = MySQL::SQLValue($iden_eau_elec);
$values["id_salarie"] = MySQL::SQLValue($nextid);
$values["INDEM"] = MySQL::SQLValue($indem_total);
$values["addby"] = MySQL::SQLValue($usrid);
if (!$db2->InsertRow("info_personnel_budgetaire", $values)) {
$db2->Kill($db2->Error());
return false;
} else {
$sql = $db2->BuildSQLInsert("info_personnel_budgetaire", $values);
return true;
}
}