本文整理汇总了PHP中pmb_mysql_insert_id函数的典型用法代码示例。如果您正苦于以下问题:PHP pmb_mysql_insert_id函数的具体用法?PHP pmb_mysql_insert_id怎么用?PHP pmb_mysql_insert_id使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pmb_mysql_insert_id函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save
function save()
{
global $dbh;
if ($this->idproc) {
$q = "update procs set ";
$q .= "requete = '" . addslashes($this->requete) . "', ";
$q .= "comment = '" . addslashes($this->comment) . "', ";
$q .= "autorisation = '" . implode(' ', $this->autorisations) . "', ";
$q .= "parameters ='" . addslashes($this->parameters) . "', ";
$q .= "num_classement = '" . $this->num_classement . "', ";
$q .= "p_mode = '" . $this->p_mode . "', ";
$q .= "p_form = '" . addslashes($this->p_form) . "' ";
$q .= "where idproc = '" . $this->idproc . "' ";
pmb_mysql_query($q, $dbh);
} else {
$q = "insert into procs set ";
$q .= "requete = '" . addslashes($this->requete) . "', ";
$q .= "comment = '" . addslashes($this->comment) . "', ";
$q .= "autorisation = '" . implode(' ', $this->autorisations) . "', ";
$q .= "parameters ='" . addslashes($this->parameters) . "', ";
$q .= "num_classement = '" . $this->num_classement . "', ";
$q .= "p_mode = '" . $this->p_mode . "', ";
$q .= "p_form = '" . addslashes($this->p_form) . "' ";
pmb_mysql_query($q, $dbh);
$this->idproc = pmb_mysql_insert_id($dbh);
}
}
示例2: _creer_transfert
function _creer_transfert($id_expl, $src, $dest, $t_trans, $date_ret = '', $origine = 0, $ori_comp = '', $motif = '', $sens = 0, $etat = 0)
{
//on recupere le no de notice
$rqt = "SELECT expl_notice, expl_bulletin, expl_statut, expl_section \n\t\t\t\tFROM exemplaires \n\t\t\t\tWHERE expl_id=" . $id_expl;
$res = pmb_mysql_query($rqt);
$expl = pmb_mysql_fetch_object($res);
//$id_notice = pmb_mysql_result( $res, 0 );
// verif si déjà existrant
$rqt = "Select * from transferts ,transferts_demande where \t\t\n\t\t\tnum_transfert=id_transfert and num_expl={$id_expl} and\t\t\t\t\t\n\t\t\tnum_notice=" . $expl->expl_notice . " and\n\t\t\tnum_bulletin=" . $expl->expl_bulletin . " and \n\t\t\ttype_transfert={$t_trans} and\n\t\t\tetat_transfert=0 and \n\t\t\torigine={$origine} and\n\t\t\torigine_comp ='" . addslashes($ori_comp) . "' and\n\t\t\tsource={$src} and\n\t\t\tdestinations ={$dest} ";
$res = pmb_mysql_query($rqt);
if (pmb_mysql_num_rows($res)) {
$obj_data = pmb_mysql_fetch_object($res);
$num = $obj_data->id_transfert;
} else {
//on cree l'enregistrement dans la table transferts
$rqt = "INSERT INTO transferts ( \n\t\t\t\t\t\tnum_notice, num_bulletin, date_creation, \n\t\t\t\t\t\ttype_transfert, etat_transfert, \n\t\t\t\t\t\torigine, origine_comp, \n\t\t\t\t\t\tsource, destinations, \n\t\t\t\t\t\tdate_retour, motif ) VALUES (" . $expl->expl_notice . ", " . $expl->expl_bulletin . ", NOW()," . $t_trans . ", 0, " . $origine . ", '" . addslashes($ori_comp) . "'," . $src . ", '" . $dest . "', \n\t\t\t\t\t\t'" . $date_ret . "', '" . addslashes($motif) . "' )";
pmb_mysql_query($rqt);
//on recupere l'id du transfert crée
$num = pmb_mysql_insert_id();
}
$rqt = "Select * from transferts_demande where\n\t\t\t\t\tnum_transfert={$num} and\t\t\t\t\t \n\t\t\t\t\tsens_transfert={$sens} and \n\t\t\t\t\tnum_location_source={$src} and \n\t\t\t\t\tnum_location_dest={$dest} and\n\t\t\t\t\tnum_expl={$id_expl} \n\t\t\t\t\t";
$res = pmb_mysql_query($rqt);
if (!pmb_mysql_num_rows($res)) {
//la table transferts_demande
$rqt = "INSERT INTO transferts_demande (\n\t\t\t\t\t\tnum_transfert, date_creation, \n\t\t\t\t\t\tsens_transfert, num_location_source, \n\t\t\t\t\t\tnum_location_dest, num_expl, \n\t\t\t\t\t\tstatut_origine, section_origine, \n\t\t\t\t\t\tetat_demande ) VALUES (" . $num . ", NOW(), " . $sens . ", " . $src . ", " . $dest . ", " . $id_expl . ", " . $expl->expl_statut . ", " . $expl->expl_section . ", " . $etat . ")";
pmb_mysql_query($rqt);
}
return $num;
}
示例3: update_notice_categories_from_form
function update_notice_categories_from_form($id_notice = 0, $id_bulletin = 0)
{
global $dbh;
global $f_nb_categ;
if (!$id_notice && $id_bulletin) {
$query = "select * from bulletins where bulletin_id=" . $id_bulletin;
$result = pmb_mysql_query($query, $dbh);
if ($result) {
$row = mysql_fetch_object($result);
if ($row->num_notice) {
$id_notice = $row->num_notice;
} else {
//on crée la notice de bulletin
global $xmlta_doctype_bulletin, $deflt_notice_statut;
pmb_mysql_query("INSERT INTO notices SET \n\t\t\t\t\ttit1 = '" . $row->bulletin_numero . ($row->mention_date ? " - " . $row->mention_date : "") . ($row->bulletin_titre ? " - " . $row->bulletin_titre : "") . "',\n\t\t\t\t\tstatut = '" . $deflt_notice_statut . "',\t\t\n\t\t\t\t\ttypdoc = '" . $xmlta_doctype_bulletin . "',\n\t\t\t\t\tcreate_date=sysdate(), update_date=sysdate() ", $dbh);
$id_notice = pmb_mysql_insert_id($dbh);
// Mise à jour des index de la notice
notice::majNoticesTotal($id_notice);
audit::insert_creation(AUDIT_NOTICE, $id_notice);
//Mise à jour du bulletin
$requete = "update bulletins set num_notice=" . $id_notice . " where bulletin_id=" . $id_bulletin;
pmb_mysql_query($requete);
//Mise à jour des liens bulletin -> notice mère
$requete = "insert into notices_relations (num_notice,linked_notice,relation_type,rank) values(" . $id_notice . "," . $row->bulletin_notice . ",'b',1)";
pmb_mysql_query($requete);
}
}
}
if (!$id_notice) {
return;
}
$query = "SELECT max(ordre_categorie) as ordre FROM notices_categories WHERE notcateg_notice='" . $id_notice . "' ";
$result = pmb_mysql_query($query);
$ordre_categ = 0;
if ($result) {
$row = mysql_fetch_object($result);
if (isset($row->ordre)) {
$ordre_categ = $row->ordre;
}
}
if ($f_nb_categ) {
$rqt_ins = "INSERT INTO notices_categories (notcateg_notice, num_noeud, ordre_categorie) VALUES ";
for ($i = 0; $i < $f_nb_categ; $i++) {
$var_categ = "f_categ{$i}";
global ${$var_categ};
if (${$var_categ}) {
$var_categid = "f_categ_id{$i}";
global ${$var_categid};
$rqt_sel = "SELECT notcateg_notice FROM notices_categories WHERE notcateg_notice='" . $id_notice . "' and num_noeud='" . ${$var_categid} . "' ";
$res_sel = pmb_mysql_query($rqt_sel, $dbh);
if ($res_sel && !pmb_mysql_num_rows($res_sel)) {
$ordre_categ++;
$rqt = $rqt_ins . " ('" . $id_notice . "','" . ${$var_categid} . "',{$ordre_categ}) ";
$res_ins = @pmb_mysql_query($rqt, $dbh);
}
}
}
}
}
示例4: save
function save()
{
global $dbh;
$req = "insert into import_marc set notice='" . addslashes($this->sugg_uni_notice) . "', \n\t\t\torigine='" . addslashes($this->sugg_uni_origine) . "',\n\t\t\tno_notice='" . addslashes($this->sugg_uni_num_notice) . "'";
pmb_mysql_query($req, $dbh);
$this->sugg_uni_id = pmb_mysql_insert_id();
$this->suggestions_unimarc($this->sugg_uni_id);
}
示例5: add_note
function add_note($idnote = 0)
{
global $dbh, $base_path, $idtype, $idobject, $comment, $ordre_cible;
$iddemande = $idobject;
$commentaire = trim($comment);
if ($ordre_cible) {
$ordre = $ordre_cible;
} else {
$req = "select max(ordre)+1 from rapport_demandes where num_demande='" . $iddemande . "'";
$res = pmb_mysql_query($req, $dbh);
$ordre = pmb_mysql_result($res, 0, 0);
}
$req = "insert into rapport_demandes set \n\t\tcontenu='" . $commentaire . "',\n\t\tnum_demande='" . $iddemande . "',\n\t\tnum_note='" . $idnote . "',\n\t\tordre = '" . $ordre . "',\n\t\ttype='" . $idtype . "'\n\t\t";
pmb_mysql_query($req, $dbh);
if ($ordre_cible) {
update_order(pmb_mysql_insert_id());
}
$req = "select rd.id_item, rd.contenu, rd.ordre, rd.type, rd.num_note, sujet_action from rapport_demandes rd left join demandes_notes on num_note=id_note left join demandes_actions on num_action=id_action where rd.num_demande='" . $iddemande . "' order by ordre";
$res = pmb_mysql_query($req, $dbh);
$display = "";
while ($item = pmb_mysql_fetch_object($res)) {
$titre = substr($item->contenu, 0, 15) . "...";
$style = "";
if (!$item->num_note) {
//Ajout manuel
switch ($item->type) {
case '1':
//Titre
$style = "style='background-color:#DECDEC' titre='yes'";
$content = $item->contenu;
break;
case '0':
//Commmentaire
$content = "* " . $item->contenu;
break;
}
} else {
$content = $item->contenu;
}
$ordre = $item->ordre;
if ($item->sujet_action) {
$contenu = "<u>" . $item->sujet_action . "</u> : " . $content;
} else {
$contenu = $content;
}
$drag = "<span id=\"rap_handle_{$item->id_item}\" style='padding-left:7px' ><img src=\"" . $base_path . "/images/notice_drag.png\" /></span>";
$del = "<span id=\"rap_del_{$item->id_item}\" style='padding-left:7px' onclick='delete_item({$item->id_item});' ><img src=\"" . $base_path . "/images/cross.png\" style='cursor:pointer;width:10px;vertical-align:middle;' /></span>";
$modif = "<span id=\"rap_modif_{$item->id_item}\" style='padding-left:7px;' onclick='modif_item({$item->id_item});' ><img src=\"" . $base_path . "/images/b_edit.png\" style='cursor:pointer;width:10px;vertical-align:middle;'/></span>";
$display .= "\n\t\t\t\t\t<div class='row' {$style} id='rap_drag_{$item->id_item}' draggable=\"yes\" dragtype=\"rapport\" dragtext=\"{$titre}\" dragicon=\"" . $base_path . "/images/icone_drag_notice.png\"\n\t\t\t\t\t\thandler=\"rap_handle_{$item->id_item}\" recepttype=\"rapport\" recept=\"yes\" highlight=\"rap_highlight\" downlight=\"rap_downlight\" iditem='{$item->id_item}' order='{$ordre}'>" . $contenu . $drag . $modif . $del . "</div>\t\t\t\n\t\t\t\t";
}
ajax_http_send_response($display);
}
示例6: update
function update($temp)
{
global $dbh;
if ($this->id_classement) {
$req = "update classements set nom_classement='" . $temp->nom_classement . "' where id_classement='" . $this->id_classement . "'";
$result = pmb_mysql_query($req, $dbh);
} else {
$req = "insert into classements set nom_classement='" . $temp->nom_classement . "', type_classement='" . $temp->type_classement . "' ";
$result = @pmb_mysql_query($req, $dbh);
$this->id_classement = pmb_mysql_insert_id();
$this->getData();
}
}
示例7: save
function save()
{
global $dbh;
if (!$this->explnum_doc_id) {
//Création
$req = "insert into explnum_doc set \n\t\t\t\t\t explnum_doc_nomfichier='" . addslashes($this->explnum_doc_nomfichier) . "',\n\t\t\t\t\t explnum_doc_mimetype='" . addslashes($this->explnum_doc_mime) . "',\n\t\t\t\t\t explnum_doc_extfichier='" . addslashes($this->explnum_doc_extfichier) . "',\n\t\t\t\t\t explnum_doc_data='" . addslashes($this->explnum_doc_contenu) . "'";
pmb_mysql_query($req, $dbh);
$this->explnum_doc_id = pmb_mysql_insert_id();
} else {
//Modification
$req = "update explnum_doc set \n\t\t\t\t\t explnum_doc_nomfichier='" . addslashes($this->explnum_doc_nomfichier) . "',\n\t\t\t\t\t explnum_doc_mimetype='" . addslashes($this->explnum_doc_mime) . "',\n\t\t\t\t\t explnum_doc_extfichier='" . addslashes($this->explnum_doc_extfichier) . "',\n\t\t\t\t\t explnum_doc_data='" . addslashes($this->explnum_doc_contenu) . "'\n\t\t\t\t\t where id_explnum_doc='" . $this->explnum_doc_id . "'";
pmb_mysql_query($req, $dbh);
}
}
示例8: save
function save()
{
global $dbh;
if (!$this->id_tache_docnum) {
//Création
$req = "insert into taches_docnum set \n\t\t\t\t\t tache_docnum_nomfichier='" . addslashes($this->tache_docnum_nomfichier) . "',\n\t\t\t\t\t tache_docnum_mimetype='" . addslashes($this->tache_docnum_mimetype) . "',\n\t\t\t\t\t tache_docnum_extfichier='" . addslashes($this->tache_docnum_extfichier) . "',\n\t\t\t\t\t tache_docnum_data='" . addslashes($this->tache_docnum_data) . "',\n\t\t\t\t\t tache_docnum_repertoire='" . addslashes($this->tache_docnum_repertoire) . "',\n\t\t\t\t\t tache_docnum_path='" . addslashes($this->tache_docnum_path) . "',\n\t\t\t\t\t num_tache='" . addslashes($this->num_tache) . "'\n\t\t\t\t\t ";
pmb_mysql_query($req, $dbh);
$this->id_tache_docnum = pmb_mysql_insert_id();
} else {
//Modification
$req = "update taches_docnum set \n\t\t\t\t\t tache_docnum_nomfichier='" . addslashes($this->tache_docnum_nomfichier) . "',\n\t\t\t\t\t tache_docnum_mimetype='" . addslashes($this->tache_docnum_mimetype) . "',\n\t\t\t\t\t tache_docnum_extfichier='" . addslashes($this->tache_docnum_extfichier) . "',\n\t\t\t\t\t tache_docnum_data='" . addslashes($this->tache_docnum_data) . "',\n\t\t\t\t\t tache_docnum_repertoire='" . addslashes($this->tache_docnum_repertoire) . "',\n\t\t\t\t\t tache_docnum_path='" . addslashes($this->tache_docnum_path) . "',\n\t\t\t\t\t num_tache='" . addslashes($this->num_tache) . "'\n\t\t\t\t\t where id_tache_docnum='" . $this->id_tache_docnum . "'";
pmb_mysql_query($req, $dbh);
}
}
示例9: save
function save()
{
global $dbh;
if ($this->libelle == '') {
die("Erreur de création statut de ligne d'acte");
}
if ($this->id_statut) {
$q = "update lignes_actes_statuts set \n\t\t\t\t\tlibelle = '" . $this->libelle . "',\n\t\t\t\t\trelance = '" . $this->relance . "'\n\t\t\t\t\twhere id_statut = '" . $this->id_statut . "' ";
$r = pmb_mysql_query($q, $dbh);
} else {
$q = "insert into lignes_actes_statuts set \n\t\t\t\t\tlibelle = '" . $this->libelle . "',\n\t\t\t\t\trelance = '" . $this->relance . "' ";
$r = pmb_mysql_query($q, $dbh);
$this->id_statut = pmb_mysql_insert_id($dbh);
}
}
示例10: save
function save()
{
global $dbh;
if ($this->libelle_categ == '') {
die("Erreur de création catégorie de suggestions");
}
if ($this->id_categ) {
$q = "update suggestions_categ set libelle_categ = '" . addslashes($this->libelle_categ) . "' ";
$q .= "where id_categ = '" . $this->id_categ . "' ";
$r = pmb_mysql_query($q, $dbh);
} else {
$q = "insert into suggestions_categ set libelle_categ = '" . addslashes($this->libelle_categ) . "' ";
$r = pmb_mysql_query($q, $dbh);
$this->id_categ = pmb_mysql_insert_id($dbh);
}
}
示例11: save
function save()
{
global $dbh;
if (!$this->libelle) {
die("Erreur de création tva_achats");
}
if ($this->id_tva) {
$q = "update tva_achats set taux_tva ='" . $this->taux_tva . "', libelle = '" . $this->libelle . "', num_cp_compta = '" . $this->num_cp_compta . "' ";
$q .= "where id_tva = '" . $this->id_tva . "' ";
$r = pmb_mysql_query($q, $dbh);
} else {
$q = "insert into tva_achats set libelle = '" . $this->libelle . "', taux_tva = '" . $this->taux_tva . "', num_cp_compta = '" . $this->num_cp_compta . "' ";
$r = pmb_mysql_query($q, $dbh);
$this->id_tva = pmb_mysql_insert_id($dbh);
}
}
示例12: save
function save()
{
global $dbh;
if ($this->libelle == '') {
die("Erreur de création paiement");
}
if ($this->id_paiement) {
$q = "update paiements set libelle ='" . $this->libelle . "', commentaire = '" . $this->commentaire . "' ";
$q .= "where id_paiement = '" . $this->id_paiement . "' ";
$r = pmb_mysql_query($q, $dbh);
} else {
$q = "insert into paiements set libelle = '" . $this->libelle . "', commentaire = '" . $this->commentaire . "' ";
pmb_mysql_query($q, $dbh);
$this->id_paiement = pmb_mysql_insert_id($dbh);
}
}
示例13: save
function save()
{
global $dbh;
if (!$this->num_thesaurus) {
die('Erreur de création noeud');
}
if ($this->id_noeud) {
//Mise à jour noeud
$q = 'update noeuds set autorite =\'' . addslashes($this->autorite) . '\', ';
$q .= 'num_parent = \'' . $this->num_parent . '\', num_renvoi_voir = \'' . $this->num_renvoi_voir . '\', ';
$q .= 'visible = \'' . $this->visible . '\', num_thesaurus = \'' . $this->num_thesaurus . '\', ';
$q .= 'authority_import_denied = \'' . $this->authority_import_denied . '\', not_use_in_indexation = \'' . $this->not_use_in_indexation . '\' ';
$q .= 'where id_noeud = \'' . $this->id_noeud . '\' ';
pmb_mysql_query($q, $dbh);
audit::insert_modif(AUDIT_CATEG, $this->id_noeud);
} else {
$q = 'insert into noeuds set autorite = \'' . addslashes($this->autorite) . '\', ';
$q .= 'num_parent = \'' . $this->num_parent . '\', num_renvoi_voir = \'' . $this->num_renvoi_voir . '\', ';
$q .= 'visible = \'' . $this->visible . '\', num_thesaurus = \'' . $this->num_thesaurus . '\', ';
$q .= 'authority_import_denied = \'' . $this->authority_import_denied . '\', not_use_in_indexation = \'' . $this->not_use_in_indexation . '\' ';
pmb_mysql_query($q, $dbh);
$this->id_noeud = pmb_mysql_insert_id($dbh);
audit::insert_creation(AUDIT_CATEG, $this->id_noeud);
}
//update authority informations
$authority = new authority(0, $this->id_noeud, AUT_TABLE_CATEG);
$authority->set_num_statut($this->num_statut);
$authority->update();
// Mis à jour du path de lui-meme, et de tous les fils
$thes = thesaurus::getByEltId($this->id_noeud);
$id_top = $thes->num_noeud_racine;
$path = '';
$id_tmp = $this->id_noeud;
while (true) {
$q = "select num_parent from noeuds where id_noeud = '" . $id_tmp . "' limit 1";
$r = pmb_mysql_query($q, $dbh);
$id_tmp = $id_cur = pmb_mysql_result($r, 0, 0);
if (!$id_cur || $id_cur == $id_top) {
break;
}
if ($path) {
$path = '/' . $path;
}
$path = $id_tmp . $path;
}
noeuds::process_categ_path($this->id_noeud, $path);
}
示例14: proceed
function proceed()
{
global $first;
switch ($this->act) {
//Enregistrer
case "update":
//Si sauv_lieu_id vide alors création
if ($this->sauv_table_id == "") {
$this->verifName();
$requete = "insert into sauv_tables (sauv_table_nom) values('')";
pmb_mysql_query($requete) or die(pmb_mysql_error());
$this->sauv_table_id = pmb_mysql_insert_id();
$first = "";
}
//Update avec les données reçues
$this->verifTables();
$this->verifName();
$requete = "update sauv_tables set sauv_table_nom='" . $this->sauv_table_nom . "', sauv_table_tables='" . implode(",", $this->sauv_table_tables) . "' where sauv_table_id=" . $this->sauv_table_id;
pmb_mysql_query($requete) or die(pmb_mysql_error());
$first = "";
break;
//Supprimer
//Supprimer
case "delete":
$requete = "delete from sauv_tables where sauv_table_id=" . $this->sauv_table_id;
pmb_mysql_query($requete) or die(pmb_mysql_error());
$this->sauv_table_id = "";
$first = 0;
break;
//Annuler
//Annuler
case "cancel":
echo "<script>history.go(-2);</script>";
exit;
break;
case "update_unsaved":
$this->updateUnsaved();
break;
//Visualiser
//Visualiser
default:
//Ne rien faire, le numéro de la fiche est déjà dans $this->sauv_lieu_id
}
return $this->showForm();
}
示例15: save
public function save()
{
if ($this->id) {
$query = "update editions_states";
$clause = " where id_editions_state = " . $this->id;
} else {
$query = "insert into editions_states";
$clause = "";
}
//On supprimer les informations de paramétrage pour les vues au cas ou on supprime un champ utilisé pour une vue
$this->state_fields_params["view"] = array();
//on va chercher les infos des filtres, tris, groupements...
$query .= " set\n\t\t\teditions_state_name = '" . addslashes($this->name) . "',\n\t\t\teditions_state_num_classement = '" . addslashes($this->classement) . "',\n\t\t\teditions_state_used_datasource = '" . addslashes($this->used_datasource) . "',\n\t\t\teditions_state_comment = '" . addslashes($this->comment) . "',\n\t\t\teditions_state_fieldslist = '" . addslashes(serialize($this->state_fields_list)) . "',\n\t\t\teditions_state_fieldsparams = '" . addslashes(serialize($this->state_fields_params)) . "'";
pmb_mysql_query($query . $clause);
if (!$this->id) {
$this->id = pmb_mysql_insert_id();
}
}