本文整理汇总了PHP中connection_mysql函数的典型用法代码示例。如果您正苦于以下问题:PHP connection_mysql函数的具体用法?PHP connection_mysql怎么用?PHP connection_mysql使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了connection_mysql函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: indexDocnum
function indexDocnum()
{
global $msg, $dbh, $charset, $PMBusername;
if (SESSrights & ADMINISTRATION_AUTH) {
$result .= "<h3>" . htmlentities($msg["docnum_reindexation"], ENT_QUOTES, $charset) . "</h3>";
$requete = "select explnum_id as id from explnum order by id";
$res_explnum = mysql_query($requete, $dbh);
if (mysql_num_rows($res_explnum)) {
while ($explnum = mysql_fetch_object($res_explnum)) {
mysql_close($dbh);
$dbh = connection_mysql();
$index = new indexation_docnum($explnum->id);
$index->indexer();
}
}
$explnum = mysql_query("SELECT count(1) FROM explnum", $dbh);
$count = mysql_result($explnum, 0, 0);
$result .= $count . " " . htmlentities($msg['docnum_reindex_expl'], ENT_QUOTES, $charset);
} else {
$result .= sprintf($msg["planificateur_rights_bad_user_rights"], $PMBusername);
}
return $result;
}
示例2: connection_mysql
$base_nosession = 1;
$base_nocheck = 1;
require_once "{$base_path}/includes/init.inc.php";
if (!$user) {
$user = $argv[1];
}
if (!$password) {
$password = $argv[2];
}
if (!$database) {
$database = $argv[3];
}
$include_path = $base_path . "/includes";
require_once "{$include_path}/db_param.inc.php";
require_once "{$include_path}/mysql_connect.inc.php";
$dbh = connection_mysql();
// on checke si l'utilisateur existe et si le mot de passe est OK
$query = "SELECT count(1) FROM users WHERE username='{$user}' AND pwd=password('{$password}') ";
$result = pmb_mysql_query($query, $dbh);
$valid_user = pmb_mysql_result($result, 0, 0);
if (!$valid_user) {
die("Interdit : utilisateur invalide ");
}
if (!$dsi_auto) {
die("DSI Auto pas activée sur base {$database} (user={$user}) Version noyau: {$pmb_bdd_version} ");
}
/* param par défaut */
$requete_param = "SELECT * FROM users WHERE username='{$user}' LIMIT 1 ";
$res_param = pmb_mysql_query($requete_param, $dbh);
$field_values = pmb_mysql_fetch_row($res_param);
$array_values = pmb_mysql_fetch_array($res_param);
示例3: choix_info
function choix_info()
{
global $msg;
global $current_module;
global $base_path;
// on n'utilse pas le template prévu pour cette étape
$create_proc_form = "\n<form class='form-{$current_module}' name='search_form' action='!!url!!' method='post'>\n\t<h3>" . $msg["create_proc"] . " (!!etape!!/5)</h3>\n\t<div class='form-contenu'>\n\t\t<div class='erreur' align='justify'><img src='" . $base_path . "/images/alert.gif'>" . $msg["warn_create_proc"] . "</div>\n\t\t<br />\n\t\t<div class='row'>\n\t\t\t<label class='etiquette' for='form_name'>{$msg['705']}</label>\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t<input type='text' name='nom_proc' value='' maxlength='255' class='saisie-50em' />\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t<label class='etiquette' for='form_comment'>{$msg['707']}</label>\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t<input type='text' name='comment' value='' maxlength='255' class='saisie-50em' />\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t<label class='etiquette' for='form_comment'>{$msg['procs_autorisations']}</label>\n\t\t\t<input type='button' class='bouton_small' value='" . $msg['tout_cocher_checkbox'] . "' onclick='check_checkbox(document.getElementById(\"auto_id_list\").value,1);' align='middle'>\n\t\t\t<input type='button' class='bouton_small' value='" . $msg['tout_decocher_checkbox'] . "' onclick='check_checkbox(document.getElementById(\"auto_id_list\").value,0);' align='middle'>\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t!!autorisations_users!!\n\t\t</div>\n\t</div>\n\t<div class='row'>\n\t\t<input type='submit' class='bouton' value='" . $msg["502"] . "' onClick=\"this.form.etape.value=!!etape_next!!; this.form.action='!!url_next!!'; this.form.page.value=''; \"/>\n\t</div>\n\t<input type='hidden' name='etape' value='!!etape!!'/>\n</form>";
// récupération des utilisateurs
$dbh = connection_mysql();
$requete_users = "SELECT userid, username FROM users order by username ";
$res_users = pmb_mysql_query($requete_users, $dbh);
$autorisation = array();
while (list($all_userid, $all_username) = pmb_mysql_fetch_row($res_users)) {
$autorisation[] = array(0, $all_userid, $all_username);
}
$autorisations_users = "";
while (list($row_number, $row_data) = each($autorisation)) {
if ($row_data[0]) {
$autorisations_users .= "<input type='checkbox' name='userautorisation[]' value='" . $row_data[1] . "' checked class='checkbox'> " . $row_data[2] . " ";
} else {
$autorisations_users .= "<input type='checkbox' name='userautorisation[]' value='" . $row_data[1] . "' class='checkbox'> " . $row_data[2] . " ";
}
}
$create_proc_form = str_replace('!!autorisations_users!!', $autorisations_users, $create_proc_form);
return $create_proc_form;
}