当前位置: 首页>>代码示例>>PHP>>正文


PHP grr_sql_query函数代码示例

本文整理汇总了PHP中grr_sql_query函数的典型用法代码示例。如果您正苦于以下问题:PHP grr_sql_query函数的具体用法?PHP grr_sql_query怎么用?PHP grr_sql_query使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了grr_sql_query函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: delete_user

function delete_user($login)
{
    $sql = "SELECT source FROM " . TABLE_PREFIX . "_utilisateurs\n\t    WHERE login LIKE '{$login}'";
    $res = grr_sql_query($sql);
    $row = grr_sql_row($res, 0);
    $source = $row[0];
    if ($source == 'ext') {
        // Si l'utilisateur avait été créé automatiquement, on le
        // supprime
        // Cf. admin_user.php l99 et l203
        $sql = "DELETE FROM " . TABLE_PREFIX . "_utilisateurs WHERE login='{$login}'";
        if (grr_sql_command($sql) < 0) {
            fatal_error(1, "<p>" . grr_sql_error());
        } else {
            grr_sql_command("DELETE FROM " . TABLE_PREFIX . "_j_mailuser_room  WHERE login='{$login}'");
            grr_sql_command("DELETE FROM " . TABLE_PREFIX . "_j_user_area      WHERE login='{$login}'");
            grr_sql_command("DELETE FROM " . TABLE_PREFIX . "_j_user_room      WHERE login='{$login}'");
            grr_sql_command("DELETE FROM " . TABLE_PREFIX . "_j_useradmin_area WHERE login='{$login}'");
            grr_sql_command("DELETE FROM " . TABLE_PREFIX . "_j_useradmin_site WHERE login='{$login}'");
        }
        // Fin de la session
        grr_closeSession($_GET['auto']);
    }
    // sinon c'est source="local": on le garde et il y a toujours accès
    // classique login/mot de passe).
}
开发者ID:nicolas-san,项目名称:GRRV4,代码行数:26,代码来源:delete_user.php

示例2: set

 static function set($_name, $_value)
 {
     if (isset(self::$grrSettings[$_name])) {
         $sql = "UPDATE " . TABLE_PREFIX . "_setting set VALUE = '" . protect_data_sql($_value) . "' where NAME = '" . protect_data_sql($_name) . "'";
         $res = grr_sql_query($sql);
         if (!$res) {
             return false;
         }
     } else {
         $sql = "INSERT INTO " . TABLE_PREFIX . "_setting set NAME = '" . protect_data_sql($_name) . "', VALUE = '" . protect_data_sql($_value) . "'";
         $res = grr_sql_query($sql);
         if (!$res) {
             return false;
         }
     }
     self::$grrSettings[$_name] = $_value;
     return true;
 }
开发者ID:nicolas-san,项目名称:GRRV4,代码行数:18,代码来源:settings.class.php

示例3: die

        }
        $grrSettings['ldap_champ_email'] = $_POST['ldap_champ_email'];
        if (!Settings::set("se3_liste_groupes_autorises", $_POST['se3_liste_groupes_autorises'])) {
            echo "Erreur lors de l'enregistrement de se3_liste_groupes_autorises !<br />";
        }
        $grrSettings['se3_liste_groupes_autorises'] = $_POST['se3_liste_groupes_autorises'];
    }
}
//Chargement des valeurs de la table settingS
if (!Settings::load()) {
    die("Erreur chargement settings");
}
if (isset($_POST['submit'])) {
    if (isset($_POST['login']) && isset($_POST['password'])) {
        $sql = "select upper(login) login, password, prenom, nom, statut from " . TABLE_PREFIX . "_utilisateurs where login = '" . $_POST['login'] . "' and password = md5('" . $_POST['password'] . "') and etat != 'inactif' and statut='administrateur' ";
        $res_user = grr_sql_query($sql);
        $num_row = grr_sql_count($res_user);
        if ($num_row == 1) {
            $valid = 'yes';
        } else {
            $message = get_vocab("wrong_pwd");
        }
    }
}
if (!grr_resumeSession() && $valid != 'yes') {
    ?>
	<!doctype html>
	<html>
		<head>
			<link rel="stylesheet" href="style.css" type="text/css">
			<title> grr </title>
开发者ID:nicolas-san,项目名称:GRRV4,代码行数:31,代码来源:admin_config_ldap.php

示例4: grr_sql_query

    if (!saveSetting("begin_bookings", $_GET['begin_bookings'])) {
        echo "Erreur lors de l'enregistrement de begin_bookings !<br />";
    } else {
        $del = grr_sql_query("DELETE FROM ".TABLE_PREFIX."_entry WHERE (end_time < ".getSettingValue('begin_bookings').")");
        $del = grr_sql_query("DELETE FROM ".TABLE_PREFIX."_repeat WHERE end_date < ".getSettingValue("begin_bookings"));
        $del = grr_sql_query("DELETE FROM ".TABLE_PREFIX."_entry_moderate WHERE (end_time < ".getSettingValue('begin_bookings').")");
        $del = grr_sql_query("DELETE FROM ".TABLE_PREFIX."_calendar WHERE DAY < ".getSettingValue("begin_bookings"));
    }

    if (!saveSetting("end_bookings", $_GET['end_bookings'])) {
        echo "Erreur lors de l'enregistrement de end_bookings !<br />";
    } else {
        $del = grr_sql_query("DELETE FROM ".TABLE_PREFIX."_entry WHERE start_time > ".getSettingValue("end_bookings"));
        $del = grr_sql_query("DELETE FROM ".TABLE_PREFIX."_repeat WHERE start_time > ".getSettingValue("end_bookings"));
        $del = grr_sql_query("DELETE FROM ".TABLE_PREFIX."_entry_moderate WHERE (start_time > ".getSettingValue('end_bookings').")");
        $del = grr_sql_query("DELETE FROM ".TABLE_PREFIX."_calendar WHERE DAY > ".getSettingValue("end_bookings"));
    }

    header("Location: ./admin_config.php");

} else if (isset($_GET['valid']) and ($_GET['valid'] == "no")) {
    header("Location: ./admin_config.php");
}
# print the page header
print_header("","","","",$type="with_session", $page="admin");
echo "<h2>".get_vocab('admin_confirm_change_date_bookings.php')."</h2>";
echo "<p>".get_vocab("msg_del_bookings")."</p>";
?>
<form action="admin_confirm_change_date_bookings.php" method='get'>
<div>
<input type="submit" value="<?php echo get_vocab("save");?>" />
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:admin_confirm_change_date_bookings.php

示例5: encode_message_utf8

    echo "<p>".get_vocab("maj_no_update_to_do")."</p>";
    echo "<p style=\"text-align:center;\"><a href=\"./\">".get_vocab("welcome")."</a></p>";
}

echo "<hr />";
if (isset($result) and ($result != '')) {
    echo "<div class=\"page_sans_col_gauche\">";
    echo "<h2>".encode_message_utf8("Résultat de la mise à jour")."</h2>";
    echo encode_message_utf8($result);
    echo $result_inter;
    echo "</div>";
}

// Test de cohérence des types de réservation
if ($version_grr > "1.9.1") {
    $res = grr_sql_query("select distinct type from ".TABLE_PREFIX."_entry order by type");
    if ($res) {
        $liste = "";
        for ($i = 0; ($row = grr_sql_row($res, $i)); $i++)
        {
            $test = grr_sql_query1("select type_letter from ".TABLE_PREFIX."_type_area where type_letter='".$row[0]."'");
            if ($test == -1) $liste .= $row[0]." ";
        }
        if ($liste != "") {
            echo encode_message_utf8("<table border=\"1\" cellpadding=\"5\"><tr><td><p><span style=\"color:red;\"><b>ATTENTION : votre table des types de réservation n'est pas à jour :</b></span></p>");
            echo encode_message_utf8("<p>Depuis la version 1.9.2, les types de réservation ne sont plus définis dans le fichier config.inc.php
            mais directement en ligne. Un ou plusieurs types sont actuellement utilisés dans les réservations
            mais ne figurent pas dans la tables des types. Cela risque d'engendrer des messages d'erreur. <b>Il s'agit du ou des types suivants : ".$liste."</b>");
            echo encode_message_utf8("<br /><br />Vous devez donc définir dans <a href= './admin_type.php'>l'interface de gestion des types</a>, le ou les types manquants, en vous aidant éventuellement des informations figurant dans votre ancien fichier config.inc.php.</p></td></tr></table>");
        }
    }
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:admin_maj.php

示例6: VerifyModeDemo

 VerifyModeDemo();
 if (!isset($_POST['cacher_lien_deconnecter'])) {
     $cacher_lien_deconnecter = "n";
 } else {
     $cacher_lien_deconnecter = "y";
 }
 if (!Settings::set("cacher_lien_deconnecter", $cacher_lien_deconnecter)) {
     echo "Erreur lors de l'enregistrement de cacher_lien_deconnecter !<br />";
 }
 if (isset($_POST['Url_portail_sso'])) {
     if (!Settings::set("Url_portail_sso", $_POST['Url_portail_sso'])) {
         echo "Erreur lors de l'enregistrement de Url_portail_sso ! <br />";
     }
 }
 if ($_POST['sso_statut'] == "no_sso") {
     $req = grr_sql_query("delete from " . TABLE_PREFIX . "_setting where NAME = 'sso_statut'");
     $grrSettings['sso_statut'] = '';
 } else {
     if (!Settings::set("sso_statut", $_POST['sso_statut'])) {
         echo "Erreur lors de l'enregistrement de sso_statut !<br />";
     }
     $grrSettings['sso_statut'] = $_POST['sso_statut'];
 }
 if (!Settings::set("lcs_statut_prof", $_POST['lcs_statut_prof'])) {
     echo "Erreur lors de l'enregistrement de lcs_statut_prof !<br />";
 }
 $grrSettings['lcs_statut_prof'] = $_POST['lcs_statut_prof'];
 if (!Settings::set("lcs_statut_eleve", $_POST['lcs_statut_eleve'])) {
     echo "Erreur lors de l'enregistrement de lcs_statut_eleve !<br />";
 }
 $grrSettings['lcs_statut_eleve'] = $_POST['lcs_statut_eleve'];
开发者ID:Sirlefou1,项目名称:GRR2,代码行数:31,代码来源:admin_config_sso.php

示例7: isset

    $reg_statut = isset($_POST["reg_statut"]) ? $_POST["reg_statut"] : NULL;
    $reg_type_auth = isset($_POST["reg_type_auth"]) ? $_POST["reg_type_auth"] : NULL;
    $nb_row++;
    for ($row = 1; $row < $nb_row; $row++) {
        if ($reg_type_auth[$row] != "ext") {
            $reg_mdp[$row] = md5(unslashes($reg_mdp[$row]));
        }
        // On nettoie les windozeries
        $reg_nom[$row] = protect_data_sql(corriger_caracteres($reg_nom[$row]));
        $reg_prenom[$row] = protect_data_sql(corriger_caracteres($reg_prenom[$row]));
        $reg_email[$row] = protect_data_sql(corriger_caracteres($reg_email[$row]));
        $test_login = grr_sql_count(grr_sql_query("SELECT login FROM " . TABLE_PREFIX . "_utilisateurs WHERE login='{$reg_login[$row]}'"));
        if ($test_login == 0) {
            $regdata = grr_sql_query("INSERT INTO " . TABLE_PREFIX . "_utilisateurs SET nom='" . $reg_nom[$row] . "',prenom='" . $reg_prenom[$row] . "',login='" . $reg_login[$row] . "',email='" . $reg_email[$row] . "',password='" . protect_data_sql($reg_mdp[$row]) . "',statut='" . $reg_type_user[$row] . "',etat='" . $reg_statut[$row] . "',source='" . $reg_type_auth[$row] . "'");
        } else {
            $regdata = grr_sql_query("UPDATE " . TABLE_PREFIX . "_utilisateurs SET nom='" . $reg_nom[$row] . "',prenom='" . $reg_prenom[$row] . "',email='" . $reg_email[$row] . "',password='" . protect_data_sql($reg_mdp[$row]) . "',statut='" . $reg_type_user[$row] . "',etat='" . $reg_statut[$row] . "',source='" . $reg_type_auth[$row] . "' WHERE login='" . $reg_login[$row] . "'");
        }
        if (!$regdata) {
            echo "<p><font color=\"red\">" . $reg_login[$row] . get_vocab("deux_points") . get_vocab("message_records_error") . "</font></p>";
        } else {
            if ($reg_stat[$row] == "nouveau") {
                echo "<p>" . $reg_login[$row] . get_vocab("deux_points") . get_vocab("admin_import_users_csv12") . "</p>";
            } else {
                echo "<p>" . $reg_login[$row] . get_vocab("deux_points") . get_vocab("message_records") . "</p>";
            }
        }
    }
}
?>
	</body>
	</html>
开发者ID:nicolas-san,项目名称:GRRV4,代码行数:31,代码来源:admin_import_users_csv.php

示例8: settype

if (isset($id_room)) {
    settype($id_room, "integer");
} else {
    $print = "all";
}
if (Settings::get("authentification_obli") == 0 && getUserName() == '') {
    $type_session = "no_session";
} else {
    $type_session = "with_session";
}
if (authGetUserLevel(getUserName(), -1) < 1 && Settings::get("authentification_obli") == 1 || !verif_acces_ressource(getUserName(), $id_room)) {
    showAccessDenied('');
    exit;
}
echo begin_page(get_vocab("mrbs") . get_vocab("deux_points") . Settings::get("company"));
$res = grr_sql_query("SELECT * FROM " . TABLE_PREFIX . "_room WHERE id={$id_room}");
if (!$res) {
    fatal_error(0, get_vocab('error_room') . $id_room . get_vocab('not_found'));
}
$row = grr_sql_row_keyed($res, 0);
grr_sql_free($res);
echo "<h3 style=\"text-align:center;\">";
echo get_vocab("room") . get_vocab("deux_points") . " " . htmlspecialchars($row["room_name"]);
$id_area = mrbsGetRoomArea($id_room);
$area_name = grr_sql_query1("select area_name from " . TABLE_PREFIX . "_area where id='" . $id_area . "'");
$area_access = grr_sql_query1("select access from " . TABLE_PREFIX . "_area where id='" . $id_area . "'");
echo "<br />(" . $area_name;
if ($area_access == 'r') {
    echo " - " . get_vocab("access");
}
echo ")";
开发者ID:BdEINSALyon,项目名称:GRR,代码行数:31,代码来源:view_room.php

示例9: grr_sql_version

function grr_sql_version()
{
    $r = grr_sql_query("select version()");
    $v = grr_sql_row($r, 0);
    grr_sql_free($r);
    return "MySQL $v[0]";
}
开发者ID:rhertzog,项目名称:lcs,代码行数:7,代码来源:mysql.inc.php

示例10: fclose

        fclose($file);
        echo "</td></tr></table>";
    }
    echo "<h1>" . get_vocab("sure") . "</h1>";
    echo "<h1><a href=\"admin_open_mysql.php?file_name={$file_name}\">" . get_vocab("YES") . "!</a>     <a href=\"admin_config.php?page_config=4\">" . get_vocab("NO") . "!</a></h1>";
    echo "</div>";
} else {
    $file = fopen($file_name, "r") or exit("Erreur de lecture de fichier!");
    $ok = "";
    $error = "";
    while (!feof($file)) {
        $line = fgets($file);
        while ($line[0] != '#' && !stristr($line, ';') && !feof($file)) {
            $line .= fgets($file);
        }
        if (grr_sql_query($line)) {
            $ok .= "1";
        } else {
            $ok .= "0";
            $error .= "<hr />" . htmlspecialchars($line);
        }
    }
    fclose($file);
    unlink($file_name);
    echo "<h3>La restauration est terminée !</h3>";
    echo strlen($ok) . " requêtes ont été exécutées ";
    if (strrpos($ok, '0')) {
        echo "avec " . substr_count($ok, '0') . " erreur(s) :";
        echo $error . "<hr />";
    } else {
        echo "sans erreurs.";
开发者ID:nicolas-san,项目名称:GRRV4,代码行数:31,代码来源:admin_open_mysql.php

示例11: Header

        }
    }
}
// Si pas de problème, retour à la page d'accueil après enregistrement
if (isset($_GET['change_done']) && !isset($ok)) {
    $_SESSION['displ_msg'] = 'yes';
    Header("Location: " . "admin_type.php?msg=" . $msg);
    exit;
}
# print the page header
print_header("", "", "", $type = "with_session");
include "admin_col_gauche.php";
echo "<div class=\"page_sans_col_gauche\">";
affiche_pop_up($msg, "admin");
if (isset($id_type) && $id_type > 0) {
    $res = grr_sql_query("SELECT * FROM " . TABLE_PREFIX . "_type_area WHERE id={$id_type}");
    if (!$res) {
        fatal_error(0, get_vocab('message_records_error'));
    }
    $row = grr_sql_row_keyed($res, 0);
    grr_sql_free($res);
    $change_type = 'modif';
    echo "<h2>" . get_vocab("admin_type_modify_modify.php") . "</h2>";
} else {
    $row["id"] = '0';
    $row["type_name"] = '';
    $row["type_letter"] = '';
    $row["order_display"] = 0;
    $row["disponible"] = 2;
    $row["couleur"] = '';
    echo "<h2>" . get_vocab('admin_type_modify_create.php') . "</h2>";
开发者ID:Sirlefou1,项目名称:GRR2,代码行数:31,代码来源:admin_type_modify.php

示例12: get_vocab

$html .= '<input type="checkbox" id="affichage" name="affichage" title="" value="n" />' . PHP_EOL;
$html .= '</div>' . PHP_EOL . '</td>' . PHP_EOL;
$html .= '<td>' . PHP_EOL . '<div> ' . PHP_EOL;
$html .= '<input type="checkbox" id="overload_mail" name="overload_mail" title="" value="n" />' . PHP_EOL;
$html .= '<input type="hidden" name="action" value="add" />' . PHP_EOL . '</div>' . PHP_EOL . '</td>' . PHP_EOL;
$html .= '<td>' . PHP_EOL . '<div> ' . PHP_EOL;
$html .= '<input type="checkbox" id="confidentiel" name="confidentiel" title="' . get_vocab("champ_confidentiel") . '" value="y" />' . PHP_EOL;
$html .= '<input type="hidden" name="action" value="add" />' . PHP_EOL . '</div>' . PHP_EOL . '</td>' . PHP_EOL;
$html .= '<td>' . PHP_EOL . '<div>' . PHP_EOL . '<input class="btn btn-primary" type="submit" name="submit" value="' . get_vocab('add') . '" /></div></td>' . PHP_EOL;
$html .= '</tr>' . PHP_EOL . '</table>' . PHP_EOL . '</form>' . PHP_EOL;
$breakkey = "";
$ouvre_table = false;
$ferme_table = false;
$ind_div = 0;
foreach ($userdomain as $key => $value) {
    $res = grr_sql_query("SELECT id, fieldname, fieldtype, obligatoire, fieldlist, affichage, overload_mail, confidentiel FROM " . TABLE_PREFIX . "_overload WHERE id_area={$key} ORDER BY fieldname;");
    if (!$res) {
        fatal_error(0, grr_sql_error());
    }
    if ($key != $breakkey && grr_sql_count($res) != 0) {
        if (!$ouvre_table) {
            $html .= '<table class="table table-bordered">';
            $ferme_table = true;
            $ouvre_table = true;
        }
        $html .= '<tr>' . PHP_EOL . '<td colspan="3">' . PHP_EOL . '<h4>Liste des champs additionnels</h4>' . PHP_EOL . '</td>' . PHP_EOL . '</tr>' . PHP_EOL;
    }
    $breakkey = $key;
    if (grr_sql_count($res) != 0) {
        for ($i = 0; $row = grr_sql_row($res, $i); $i++) {
            $html .= '<tr>' . PHP_EOL;
开发者ID:Sirlefou1,项目名称:GRR2,代码行数:31,代码来源:admin_overload.php

示例13: get_vocab

$tplArray['vocab']['signaler_reservation_en_cours'] = get_vocab('signaler_reservation_en_cours');
$tplArray['vocab']['explications_signaler_reservation_en_cours'] = get_vocab('explications_signaler_reservation_en_cours');
$tplArray['vocab']['signaler_reservation_en_cours_option_0'] = get_vocab('signaler_reservation_en_cours_option_0');
$tplArray['vocab']['signaler_reservation_en_cours_option_1'] = get_vocab('signaler_reservation_en_cours_option_1');
$tplArray['vocab']['signaler_reservation_en_cours_option_2'] = get_vocab('signaler_reservation_en_cours_option_2');
$tplArray['vocab']['necessite_fonction_mail_automatique'] = get_vocab('necessite fonction mail automatique');
$tplArray['vocab']['envoyer maintenant mail retard'] = get_vocab('envoyer maintenant mail retard');
$tplArray['vocab']['status_courrier'] = get_vocab('status_courrier');
$tplArray['vocab']['msg_courrier'] = get_vocab('msg_courrier');
$tplArray['vocab']['Generer_pdf'] = get_vocab('Generer_pdf');
$tplArray['vocab']['status_clef'] = get_vocab('status_clef');
$tplArray['vocab']['msg_clef'] = get_vocab('msg_clef');
/* Partie sur les périodicités*/
if ($repeat_id != 0) {
    $tplArray['repeatId'] = true;
    $res = grr_sql_query('SELECT rep_type, end_date, rep_opt, rep_num_weeks, start_time, end_time FROM ' . TABLE_PREFIX . "_repeat WHERE id={$repeat_id}");
    if (!$res) {
        fatal_error(0, grr_sql_error());
    }
    if (grr_sql_count($res) == 1) {
        $row6 = grr_sql_row($res, 0);
        $rep_type = $row6[0];
        $rep_end_date = utf8_strftime($dformat, $row6[1]);
        $rep_opt = $row6[2];
        $rep_num_weeks = $row6[3];
        $start_time = $row6[4];
        $end_time = $row6[5];
        $duration = $row6[5] - $row6[4];
    }
    grr_sql_free($res);
    if ($enable_periods == 'y') {
开发者ID:nicolas-san,项目名称:GRRV4,代码行数:31,代码来源:view_entry.php

示例14: showAccessDenied

        echo "</div>";
    }
}
if ($type == "area") {
    // Seul l'admin peut supprimer un domaine
    if (authGetUserLevel(getUserName(), $id_area, 'area') < 5) {
        showAccessDenied($back);
        exit;
    }
    //We are only going to let them delete an area if there are
    //no rooms. its easier
    $n = grr_sql_query1("SELECT count(*) FROM " . TABLE_PREFIX . "_room WHERE area_id={$id_area}");
    if ($n == 0) {
        // Suppression des champ additionnels
        $sqlstring = "SELECT id FROM " . TABLE_PREFIX . "_overload WHERE id_area='" . $id_area . "'";
        $result = grr_sql_query($sqlstring);
        for ($i = 0; $field_row = grr_sql_row($result, $i); $i++) {
            $id_overload = $field_row[0];
            // Suppression des données dans les réservations déjà effectuées
            grrDelOverloadFromEntries($id_overload);
            $sql = "DELETE FROM " . TABLE_PREFIX . "_overload WHERE id={$id_overload};";
            grr_sql_command($sql);
        }
        //OK, nothing there, lets blast it away
        grr_sql_command("DELETE FROM " . TABLE_PREFIX . "_area WHERE id={$id_area}");
        grr_sql_command("update " . TABLE_PREFIX . "_utilisateurs set default_area = '-1', default_room = '-1' WHERE default_area='" . $id_area . "'");
        grr_sql_command("DELETE FROM " . TABLE_PREFIX . "_area_periodes WHERE id_area={$id_area}");
        grr_sql_command("DELETE FROM " . TABLE_PREFIX . "_j_useradmin_area WHERE id_area={$id_area}");
        grr_sql_command("DELETE FROM " . TABLE_PREFIX . "_j_type_area WHERE id_area={$id_area}");
        grr_sql_command("DELETE FROM " . TABLE_PREFIX . "_j_user_area WHERE id_area={$id_area}");
        grr_sql_command("DELETE FROM " . TABLE_PREFIX . "_j_site_area WHERE id_area={$id_area}");
开发者ID:Sirlefou1,项目名称:GRR2,代码行数:31,代码来源:admin_room_del.php

示例15: saveSetting

/**
 * Save a name, value pair to the database
 *
 * Use this function ponctually. If you need to save several settings,
 * you'd better write your own code
 *
 * Returns the result of the operation
 *
 * @_name               string                  The name of the setting to save
 * @_value              string                  Its value
 *
 * @return              bool                    The result of the operation
 */
function saveSetting($_name, $_value)
{
    global $grrSettings;
    if (isset($grrSettings[$_name])) {
    $sql = "update ".TABLE_PREFIX."_setting set VALUE = '" . protect_data_sql($_value) . "' where NAME = '" . protect_data_sql($_name) . "'";
    $res = grr_sql_query($sql);
         if ( ! $res) return (false);
    } else {
        $sql = "insert into ".TABLE_PREFIX."_setting set NAME = '" . protect_data_sql($_name) . "', VALUE = '" . protect_data_sql($_value) . "'";
    $res = grr_sql_query($sql);
        if ( ! $res) return (false);
    }
    $grrSettings[$_name] = $_value;
    return (true);
}
开发者ID:rhertzog,项目名称:lcs,代码行数:28,代码来源:settings.inc.php


注:本文中的grr_sql_query函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。