本文整理汇总了PHP中CBdd::insert方法的典型用法代码示例。如果您正苦于以下问题:PHP CBdd::insert方法的具体用法?PHP CBdd::insert怎么用?PHP CBdd::insert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBdd
的用法示例。
在下文中一共展示了CBdd::insert方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: insert_grp
static function insert_grp($grp,$nbfic,$inbml,$etat=1)
{
$date = date("Y-m-d H:i:s");
$zSql = " INSERT INTO moul_groupes (id,nom,fichiers,mails,date_creation,etat) ";
$zSql .= " VALUES ('','" . $grp . "','" . $nbfic . "','" . $inbml . "','" . $date . "','" . $etat . "') ";
CBdd::insert($zSql);
}
示例2: insert
static function insert($gp,$zfic)
{
$date = date("Y-m-d H:i:s");
$zSql = " INSERT INTO moul_gpficmail (idgf,grp,fic,dateCreation) ";
$zSql .= " VALUES ('','" . $gp . "','" . $zfic . "',' " . $date . "') ";
CBdd::insert($zSql);
}
示例3: send
static function send($destinataire) {
$expediteur = CBdd::select_one("SELECT email FROM user WHERE type = 2", "email");
$id_texte = CConfiguration::get_valeur('WELCOME_TEXT_ID');
$sql_texte_select = "SELECT * FROM texte WHERE id = " . $id_texte;
$texte = CBdd::select_row($sql_texte_select);
$sql_user = "SELECT * FROM user WHERE email = '" . $destinataire . "'";
$user = CBdd::select_row($sql_user);
$message = str_replace('$NOM', $user['nom'], $texte['text']);
$message = str_replace('$PRENOM', $user['prenom'], $message);
//echo $message;
$sujet = $texte['nom'];
$sql_unicite_message = "SELECT id FROM email WHERE destinataire = '" . addslashes($destinataire) . "' AND nom = '" . addslashes($sujet) . "'";
// echo $sql_unicite_message;
if(CBdd::select_one($sql_unicite_message, 'id')) {
return 1;
}
$sql_email_insert = "INSERT INTO email(expediteur, destinataire, nom, text, etat) VALUES ('" . addslashes($expediteur) . "', '" . addslashes($destinataire) . "', '" . addslashes($sujet) . "', '" . addslashes($message) . "', '2')";
CBdd::insert($sql_email_insert);
return CMail::send_mail($destinataire, CFonction::force_stripslashes($sujet), CFonction::force_stripslashes($message), $expediteur, array(), 'Bcc: ' . $expediteur);
}
示例4: insert
function insert() {
$insert = '';
$values = '';
$where = '';
$date = (@$this->table['date']) ? $this->table['date'] : date("Y-m-d H:i:s");
if(!empty($this->table['idcat'])) {
$where = " where idcat = " . $this->table['idcat'];
} else if (!empty($this->table['idart'])) {
$where = " where idart = " . $this->table['idart'];
} else if (!empty($this->table['idgal'])) {
$where = " where idgal = " . $this->table['idgal'];
} else if (!empty($this->table['id_page'])) {
$where = " where id_page = " . $this->table['id_page'];
}
$arr_key = array_keys($this->table);
foreach($arr_key as $key) {
if($key != 'tablename' && $key != 'rang' && $key != 'date') {
$insert = $insert . "," . $key;
$values = $values . ",'" . @$this->table[$key] . "'";
}
}
$table_list = array('categorie', 'article', 'page', 'pdf', 'reference', 'image', 'galerie', 'video', 'faqs', 'question');
if(in_array($this->table['tablename'], $table_list)) {
$sql1 = "select max(rang)+1 as nextrang from " . $this->table['tablename'] . $where;
$nextrang = CBdd::select_one($sql1, 'nextrang');
$nextrang = $nextrang?$nextrang:1;
$insert = $insert . ",rang" ;
$values = $values . ",'".$nextrang."'";
}
$insert = $insert . ",date";
$values = $values . ",'" . $date . "'";
$insert = substr($insert, 1);
$values = substr($values, 1);
$sql2 =
"INSERT INTO " . $this->table['tablename'] . " (" .
$insert . ")
VALUES (" .
$values . ")";
if(!self::exist()) {
$out = CBdd::insert($sql2);
$this->table['id'] = $out;
return $out;
}
return false;
}
示例5: load
function load($message_number) {
$sql_0 = "INSERT INTO email(id, nom, text, expediteur, destinataire, date, imap) VALUES ";
$sql_1 = "";
$info = $this->get_info($message_number);
$sql_1 = "(null, '". addslashes($info['subject']) . "', '" . addslashes($this->get_text($message_number)) . "', '". $info['from'] . "', '". $info['to'] . "', '". $this->formate_date($info['date']) . "', '". $info['message_id'] . "'),";
$sql = $sql_1 ? trim($sql_0 . $sql_1, ",") : "";
if($sql) {
return CBdd::insert($sql);
} else {
return false;
}
}
示例6: strpos
break;
}
$image = CUserFile::upload_file($files, SS_ADMIN_TO_USERFILE.'/'.$url_dest, $unzip);
$line='tmp/';
$position = strpos($image,$line);
$depart=$position+4;
$image_ = substr($image, $depart, 50);
$img = CTraitementGestPhoto::traitFicchier($image);
$vignette = CTraitementGestPhoto::traitVign($image);
unlink($image);
$maxRang = CBdd::select_one("SELECT MAX(rang) as rangMax FROM image" ,"rangMax") ;
$iRang = ($maxRang>0) ? $maxRang +1 : 1 ;
$img = substr($img,6) ;
$vignette = substr($vignette,6) ;
$sqlInsert = "INSERT INTO entreprise (image_ent) VALUES ('$vignette')" ;
CBdd::insert($sqlInsert) ;
}
}
// FIN TRAITMENT IMAGE
if ($date_contact!='0000-00-00 00:00:00') $date = $date_contact;
else $date = date("Y-m-d");
// TEST ERREUR SECTEUR CAT ET PAYS COMM OBLIGATOIRE
if ($nom_sec == 0) {
$error_type5 = 5;
$error_signe['nom_sec'] = "*";
}
if ($nom_cat == 0) {
示例7: insert2
function insert2($table, $condition) {
$Zsql = "INSERT INTO ".$table." SET ".$condition;
$res = CBdd::insert($Zsql);
return $res;
}
示例8: date
$date = date("Y-m-d H:i:s");
$zSql = " INSERT INTO moul_tables (mlt_id,mlt_zMail,mlt_iListId,mlt_zDateCreation) " ;
$zSql .= " VALUES('','" . $toItm1['mtp_zMail'] . "','" . $toItm1['mtp_iListId'] . "','" . $date . "') " ;
CBdd::insert($zSql) ;
// Insertion de l'adresse mail dans contact avec comme login, passe et nom le nom du compte
$exp_mail = explode('@',$toItm1['mtp_zMail']);
// Les adresses valides venant de la Moulinette a pour opportunité : contactmail
$zSql = " SELECT id FROM opportunite WHERE nom = 'contactmail'" ;
$id_opp = CBdd::select_one($zSql,'id') ;
// La civilité par défaut : 1 => Monsieur
$zSql = " INSERT INTO user (login,passe,civilite,nom,email,etat_contact,idopportunite,date) " ;
$zSql .= " VALUES('" . $exp_mail[0] . "','" . $exp_mail[0] . "','1','" . $exp_mail[0] . "','" . $toItm1['mtp_zMail'] . "','1','" . $id_opp ."','" . $date . "') " ;
print ($zSql);
CBdd::insert($zSql);
}
// --- On met à jour le statut du mail pour dire qu'on l'a traité
$zSql = " UPDATE moul_tables_tmp SET mtp_iEtat = 2 ";
$zSql .= " WHERE mtp_iEtat = 1 AND mtp_id = ".$toItm1['mtp_id'];
CBdd::update($zSql);
}
}
// }
?>
示例9: COUNT
$user_id = CTableUser::get_id_by_email($mail);
}
else {
$zColIdUser = 'retour_email_id_gr_user';
$zTableUser = 'gr_user';
$user_id = CTableGrUser::get_id_by_email($mail);
}
// Par précaution sur l'existence de l'utilisateur dans la base
if ( $user_id != '' ){
$zSql2 = "SELECT COUNT(*) AS num FROM retour_email WHERE retour_email_id_email ='".$id."' AND " . $zColIdUser . " ='".$user_id."'";
$iNbRowMatch = CBdd::select_one($zSql2,'num');
if ((int)($iNbRowMatch) > 0) {
$zSql3 = "UPDATE retour_email SET retour_email_statut='2', retour_email_lien='1' WHERE retour_email_id_email ='".$id."' AND " . $zColIdUser . " = ". $user_id;
$resUpdate = CBdd::update($zSql3);
}
else {
$zSql3 = "INSERT INTO retour_email (retour_email_id_email, " . $zColIdUser . ", retour_email_statut, retour_email_lien) VALUES ('".$id."', '".$user_id."', '2', '1')";
$resInsert = CBdd::insert($zSql3);
}
}
// Redirection vers le lien cliqué par le Client
header('Location:'.$url);
}
else {
echo 'Lien non trouvé';
}
?>
示例10: header
<?php
header('Content-Type: text/html; charset=ISO-8859-1');
include("../inc/init.php");
$motcle = $_POST['type'];
$idcat = $_POST['type2'];
$Zsql = "INSERT INTO motcle (nom_motcle, cat_motcle) VALUES (
'". htmlentities(addslashes($motcle),ENT_COMPAT ,'UTF-8') . "', "
.$idcat. ")";
CBdd::insert($Zsql);
$Zsql = "SELECT nom_motcle, id_motcle FROM motcle WHERE cat_motcle=".$idcat;
//print_r($Zsql);
$requetMot = CBdd::select($Zsql);
if ($requetMot){
$i = 0;
while ($listeMot = mysql_fetch_array($requetMot)) {
$i++;
// TRAITEMENT SUPPRESSION //
//else $sql = 'DELETE FROM '.$this->table['tablename'].' WHERE (id = '.$this->table['id'].')';
//CBdd::delete($sql);
if (($_GET['p']==7) && ($listeMot['id_motcle'] == $_GET['idm'])) {
$Zsql = "DELETE FROM motcle WHERE id_motcle =".$listeMot['id_motcle'];
CBdd::delete($Zsql);
$listeMot['id_motcle']='vide';
}
if ($listeMot['id_motcle']!='vide'){
?>
<li class="clear" <? if ($i == 1) echo 'style="border-top:1px solid #e4b097";'; ?> >
<span><? echo $listeMot['nom_motcle']?></span>
<a href="<? if (($_GET['s']==7) && ($listeMot['id_motcle'] == $_GET['idm'])) echo '?id='.$idcat.'&idm='.$listeMot['id_motcle'].'&a=5&s=7&p=7'; else echo '?id='.$idcat.'&idm='.$listeMot['id_motcle'].'&a=5&s=7' ?>" title="Supprimer" style="width:15px; text-align:center;padding-right:7px"><? if (($_GET['s']=='7') && ($listeMot['id_motcle'] == $_GET['idm'])) echo 'OK?'; else echo '<img src=\'../img/delete.png\' alt=\'delete\' />'; ?></a>
</li>
示例11: hbpiecesjointes
break;
case 4 : // --- Ajout affichage
$toPieces['id'] = $id ;
$toPieces['piece'] = $piece ;
$toPieces['etat'] = $etat ;
break;
case 44 : // --- Ajout traitement
$_SESSION['url_base_fils'] = $url_dest;
$piece = CFile::upload_file($_FILES['piece'], $url_dest, $unzip, true) ;
$toInfos = CFile::get_info_file($piece) ;
if (isset($toInfos['size']) && $toInfos['size'] < 10000000)
{
$sql = "INSERT INTO hbpiecesjointes (id,piece,etat) VALUES ('','" . $piece . "','" . $etat . "')" ;
CBdd::insert($sql);
$msginfo = "Pieces jointes bien ajoutés" ;
$a = 0 ;
}
else
{
$msginfo = "La pièce jointe a dépassé 10Mo" ;
$a = 4 ;
}
break;
case 5 : // --- Modification affichage
$sql = "SELECT * FROM hbpiecesjointes WHERE id = " . $id ;
$toPieces = CBdd::select_row($sql);
break;
示例12: CTableGroupe
if($valid == 1) {
if ($bIsGrGrp == 0){
$obj = new CTableGroupe(array('id'=>$destinataire));
$groupe = $obj->select_row();
}
else{
$obj = new CTableGrGroupe(array('id'=>$destinataire));
$groupe = $obj->select_row();
}
$zSql = " ";
$zSql .= " INSERT INTO email (id,nom,id_groupe,type_envoi,destinataire,expediteur,id_text,id_campagne,text,pj,imap,type,periode,date) " ;
$zSql .= " VALUES ('',\"".CFunction::addslashes($texte['nom'])."\",\"".$destinataire."\",\"".$bIsGrGrp."\",\"".$groupe['nom']."\",\"".$expediteur."\"" ;
$zSql .= " ,".$texte['id'].",".$id_campagne.",\"".CFunction::addslashes($texte['text'])."\",'','','campagne',0,'".$date."')";
$result = CBdd::insert($zSql);
if(!$result) {
echo 'INSERT_ERROR, 0';
}
else {
echo 'Enregistrement réussi';
}
}
else{
echo 'Cette date est déja passée ou prise';
}
break;
case 5: // AFFICHAGE POUR MODIFICATION
$t_envoi = new CTableEmail(array('id'=>$id));
示例13: insert
static function insert($id,$nom,$fic,$date)
{
$zSql = " INSERT INTO moul_groupes_tmp (tmp_id,tmp_grp,tmp_fic,tmp_date) ";
$zSql .= " VALUES (" . $id . "," . $nom . "," . $fic . ",'" . $date . "') ";
CBdd::insert($zSql);
}
示例14: date
if (!CCaptcha::testCode($_REQUEST['code'])) {
echo 'NOT_SECURE';
exit(0);
}
/*---------------------------------------------------------------------
RECUPERATION
----------------------------------------------------------------------*/
$id_page = !empty($_REQUEST['id_page']) ? $_REQUEST['id_page'] : "";
/*---------------------------------------------------------------------
TRAITEMENTS
----------------------------------------------------------------------*/
$sql1 = "SELECT * FROM question WHERE etat = 1 ORDER BY id";
$res = CBdd::select($sql1);
$sql2 = "";
$first= true;
$date = date("Y-m-d H:m:s");
while($question = mysql_fetch_array($res)) {
$reponse = $_REQUEST['q'.$question['id']];
if($first) $sql2 .= "INSERT INTO reponse(nom, question, date) VALUES" ; else $sql2 .= ",";
$sql2 .= "('" . addslashes(trim($reponse)) . "', '" . addslashes(trim($question['nom'])) . "', '" . $date . "')" ;
$first = false;
}
CBdd::insert($sql2);
echo "../../inscription/src/formulaire.php?cle=inscription-en-ligne&p=".$id_page."&date=".$date;
?>
示例15: insert
static function insert($mail,$file)
{
$date = date("Y-m-d H:i:s");
$zSql = " INSERT INTO moul_tables_tmp (mtp_id,mtp_iListId,mtp_zMail,mtp_iEtat,mtp_zDateCreation) VALUES('','" . $file . "','" . $mail . "','0','".$date."') ";
CBdd::insert($zSql);
}