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


PHP CBdd::select_one方法代码示例

本文整理汇总了PHP中CBdd::select_one方法的典型用法代码示例。如果您正苦于以下问题:PHP CBdd::select_one方法的具体用法?PHP CBdd::select_one怎么用?PHP CBdd::select_one使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CBdd的用法示例。


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

示例1: 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);
	}
开发者ID:rakotobe,项目名称:Rakotobe,代码行数:30,代码来源:CWelcome.php

示例2: get_nbr_fic_of_grp

	static function get_nbr_fic_of_grp($igrp)
	{
		$zSql 	 = " ";
		$zSql 	.= " SELECT COUNT(*) AS nbrfic FROM moul_gpficmail ";
		$zSql 	.= " WHERE grp = " . $igrp ;
		$inbf	 = CBdd::select_one($zSql,'nbrfic');
		
		return $inbf;
	}
开发者ID:rakotobe,项目名称:Rakotobe,代码行数:9,代码来源:CTableMoulGpFic.php

示例3: get_elm

		static function get_elm($iIdGpMl)
		{
				$zSql 	 = " ";
				$zSql 	.= " SELECT nom FROM moul_groupes ";
				$zSql 	.= " WHERE id = " . $iIdGpMl;
				$zNom = CBdd::select_one($zSql,'nom');
			
			return $zNom;
		}
开发者ID:rakotobe,项目名称:Rakotobe,代码行数:9,代码来源:CTableGrpMl.php

示例4: get_option

	static function get_option($selectedvalue, $idconfiguration) {
		   $option = "";
		   $sql = "SELECT choix FROM configuration WHERE id = " . $idconfiguration;
		   $result = CBdd::select_one($sql, "choix");
		   $choix_possible = explode('|', $result);
		   foreach($choix_possible as $valeur) {
		   		$selected = CForm::get_selected($selectedvalue, $valeur);
		   		$option = $option . "<option value='" . $valeur . "'" . $selected . ">" . $valeur . "</option>\n";
		   }
		   return $option;
	}
开发者ID:rakotobe,项目名称:Rakotobe,代码行数:11,代码来源:CFormConfiguration.php

示例5: get_iEmail

	static function get_iEmail($zFic = '', $zmail=''){
			$zSql = " SELECT COUNT(*) AS emv FROM moul_tables WHERE 1=1 ";
			if($zFic){
				$zSql .=" AND mlt_iListId = '" . $zFic . "'";
			}
			if($zmail){
				$zSql .=" AND mlt_zMail = '" . $zmail . "'";
			}
			$iRes = CBdd::select_one($zSql,'emv');
		return $iRes;
	}
开发者ID:rakotobe,项目名称:Rakotobe,代码行数:11,代码来源:CTableMoulGp.php

示例6: test_ficgrpmail_in_campagne

	public static function test_ficgrpmail_in_campagne($iType=0,$iId=0){
		$zSql = " ";
		$zSql .= " SELECT id_groupe FROM campagne ";
		if($iType == 2){
			$zSql .= " INNER JOIN email ON ( email.id_campagne = campagne.id ) ";
			$zSql .= " INNER JOIN moul_groupes ON ( moul_groupes.id = email.id_groupe) ";
			$zSql .= " WHERE email.id_groupe = " . $iId . " AND email.type_groupe = " . $iType;
			$oRes = CBdd::select_one($zSql,'id_groupe');
			if($oRes) return 1;
			else return 0;
		}
	}
开发者ID:rakotobe,项目名称:Rakotobe,代码行数:12,代码来源:CTableCampagne.php

示例7: get_down

	static function get_down($tablename, $id, $actif=0) {
		if($actif) {
			$sql = "select isendrang_" . $tablename . "(" . $id . ") as ok";
			$res = CBdd::select_one($sql, 'ok');
			$ret = ($res!=1) ? "<a href=?id=$id&a=1><img src='../img/downarrow.png' alt='down' /></a>" : "";
		} else {
			$sql = "select isendrang_" . $tablename . "(" . $id . ") as ok";
			$res = CBdd::select_one($sql, 'ok');
			$ret = ($res!=1) ? "<img src='../img/downarrow.png' alt='down' class='grise'/>" : "";
		}
		return $ret;
	}
开发者ID:rakotobe,项目名称:Rakotobe,代码行数:12,代码来源:CHtml_.php

示例8: delete_user

	function delete_user($md5_id) {
		$sql = "SELECT email FROM user WHERE md5(id) = '".$md5_id."'";
		$user_email = CBdd::select_one($sql, 'email');
		
		$sql = "SELECT * FROM email WHERE destinataire LIKE '%".$email."%'";
		
		$result = CBdd::select($sql);
		
		$count = mysql_num_rows($result);
		
		if(count($count)) {
			while($email = mysql_fetch_array($result, MYSQL_ASSOC)) {
				$destinataire = $email['destinataire'];
				$destinataire = str_replace($user_email, '', $destinataire);	
							
				$destinataire  = str_replace(array(',,', ';;', ';'), ",", $destinataire);
				
				$email['destinataire'] = trim($destinataire, ',');				
				
				if(empty($destinataire)) {
					$_email = new CTableEmail(array('id'=>$email['id']));
					$_email->delete();
				}
				else {
					
					//unset($email[id]);
					$email['text'] = CFunction::addslashes($email['text']);
					
					if(empty($email['id_campagne'])) {
						$email['id_campagne'] = 0;
					}
					
					if(empty($email['id_groupe'])) {
						$email['id_groupe'] = 0;
					}
					
					$_email = new CTableEmail($email);					
					$_email->update();
				}
			}
		}
		
		$sql = "DELETE FROM user WHERE md5(id) = '" . $md5_id . "'";			
		return CBdd::delete($sql);
	}
开发者ID:rakotobe,项目名称:Rakotobe,代码行数:45,代码来源:CDesinscription.php

示例9: select_user

	static function select_user($cible) {
		$sql = "SELECT text FROM groupe WHERE id = '" . $cible . "' OR nom = '" . $cible. "'";
		$liste_id_user = CBdd::select_one($sql, "text");
		$where = ($liste_id_user) ? "id=" . str_replace("|", " OR id=", $liste_id_user) : " id = '-1'";
		$sql = "SELECT * FROM user WHERE " . $where;
		$res = CBdd::select($sql);
		return $res;
	}
开发者ID:rakotobe,项目名称:Rakotobe,代码行数:8,代码来源:CTableGroupe.php

示例10: recupnomCom

	function recupnomCom($table, $recherche, $condition, $conditionVal ) {
		$Zsql = "SELECT ".$recherche." FROM ".$table." WHERE ".$condition."='".$conditionVal."'";
		$res = CBdd::select_one($Zsql, $recherche);
		return $res;
	}
开发者ID:rakotobe,项目名称:Rakotobe,代码行数:5,代码来源:CCom.php

示例11: get_element

	static function get_element($cible, $element_name = "nom") {
		$sql = "SELECT " . $element_name . " FROM entreprise WHERE id_ent = '" . $cible . "' OR mail_ent = '" . $cible . "' OR nom = '" . $cible . "' OR prenom = '" .  $cible . "'";
		$element = CBdd::select_one($sql, $element_name);
		return $element;
	}
开发者ID:rakotobe,项目名称:Rakotobe,代码行数:5,代码来源:CTableUtilisateur.php

示例12:

                if(!empty($_GET['id_texte'])) 		$id_texte 		= trim($_GET['id_texte']);
                if(!empty($_GET['pj']))  			$pj 			= trim($_GET['pj']);
                if(!empty($_GET['date']))  			$date 			= trim($_GET['date']);
                break;

            case 44 : // Ajouter 2
                if(!empty($_POST['destinataire'])) 	$destinataire 	= trim($_POST['destinataire']);
                if(!empty($_POST['id_texte'])) 		$id_texte 		= trim($_POST['id_texte']);
                if(!empty($_POST['pj']))  			$pj 			= trim($_POST['pj']);
                if(!empty($_POST['date']))   		$date 			= trim($_POST['date']);


                $liste_email = CTableGroupe::get_liste_email($destinataire);

                $sql = "SELECT id FROM groupe WHERE nom = '" . $destinataire. "'";
                $_id_groupe = CBdd::select_one($sql, "id");

                $is_email = CMail::is_email($liste_email);

                if (!$is_email) {
                    $error_type = 1;
                    $error_signe['destinataire'] = "*";
                }

                if (!CMail::is_email($expediteur)) {
                    $error_type = 2;
                    $error_signe['expediteur'] = "*";
                }
                if (empty($id_texte)) {
                    $error_type = 3;
                    $error_signe['id_texte'] = "*";
开发者ID:rakotobe,项目名称:Rakotobe,代码行数:31,代码来源:envoi-old.php

示例13: while

			<th align="left"><a href="?order=urlCommune">Url</a></th>
            <th><a href="?order=date_com">Date d'ajout</a></th>
            <th>Modif</th>
            <th title="suppr"> Suppr </th>
			<th><input name="select" type="checkbox" id="select" onclick="reverse_check()" value="" /></th>
    </tr><?php
	  $i = 0; 
	 
	 if ($requetCcom){
	  while ($listeCom = mysql_fetch_assoc($requetCcom)) {
	  
		//----------- Owen recuperation nom pays pour commune
	  	$sqlNomCat = "select pays FROM departement WHERE id_dep='".$listeCom['departement']."'";
		$id_pays = CBdd::select_one($sqlNomCat, 'pays');
		$Zsql = "SELECT nom FROM pays WHERE id_pays=".$id_pays;
		$nom_pays = CBdd::select_one($Zsql, 'nom');
		
	  ?>
      <tr>
        <td><a href="?a=5&id=<?php echo $listeCom['id_com'] ?>"><?php echo $listeCom['id_com'] ?></a></td>
		<td><?php echo utf8_encode($listeCom['nom_com']) ?></td>
		<td><?php echo $listeCom['CP'] ?></td>
		<td><?php echo $nom_pays ?></td>	
		<td><?php echo $listeCom['urlCommune'] ?></td>	
        <td align="center"><?php echo CDate::date_switch(CDate::formate_date($listeCom['date_com'])) ?></td>
        <td align="center"><a href="commune.php?a=5&id=<?php echo $listeCom['id_com'] ?>" target="_parent"><img src="../img/b_edit.png" alt="modifier, afficher" /></a></td>
        <td align="center"><?php echo CHtmlSession::get_delbutton($a, $listeCom['id_com'], $id, $listeCom['idreda']) ?></td>
		<td align="center"><input type="checkbox" name="ids[]" class="id_del" value="<?php echo $listeCom['id_com'] ?>"/></td>
	  </tr>
      <?php 
	  $i++;
开发者ID:rakotobe,项目名称:Rakotobe,代码行数:31,代码来源:user_groupeCommune.php

示例14: while

?>
        <table  style="width: 500px; margin-left: 1px;" border="1" cellpadding="0" cellspacing="0">
          <tr align="center">
		    <th align="left"><a href="?order=id_dep">id</a></th>
		    <th align="left"><a href="?order=nom">Departemenent</a></th>
            <th align="left"><a href="?order=pays">pays</a></th>
           
            <th>Modif</th>
            <th title="suppr"> Suppr </th>
          </tr>
          <?
		  $i = 0; 
		  if($requetPays){
		  while ($pays = mysql_fetch_array($requetPays)) {
			$Zsql = "SELECT nom FROM pays WHERE id_pays='".$pays['pays']."'";
			$nom = CBdd::select_one($Zsql, 'nom');
			//$idcom_=CBdd::select_one($sql_idcom, 'idcom');

	      ?>
          <tr>
            <td><a href="?a=5&id=<? echo $pays['id_dep'] ?>"><? echo utf8_decode($pays['id_dep']) ?></a></td>
            <td><? echo ucfirst(strtolower(trim($pays['nom']))) ?></td>
			<td><? echo $nom; ?></td>
            <td align="center"><? echo CHtml::get_editbutton($pays['id_dep'], $pays['idreda'], $pays['idreda']) ?></td>
            <td align="center"><? echo CHtmlSession::get_delbutton($a, $pays['id_dep'], $id, $pays['idreda']) ?></td>
          </tr>
          <? } ?>
        </table>
        <? 
		}
		}
开发者ID:rakotobe,项目名称:Rakotobe,代码行数:31,代码来源:departement.php

示例15: CTableGroupe

	break;
	
case 555 : // Vider
	if(!empty($_GET['id'])) $id = $_GET['id'];
	$tgroupe= new CTableGroupe(array('id'=>$id, 'text'=>''));
	$_group  = $tgroupe->select_row();
	
	// Owen 01/2011 pour echaper au session de suppression
	$_SESSION['id']=x;
	//
	$nom = $_group['nom'];
	$id1= $_group['id'];
	$etat = $_group ['etat'];

	$sql1 = "SELECT text FROM groupe WHERE id = " . $id1;
	$text	= CBdd::select_one($sql1,'text');
	
	// Owen 01/2011 suppression contact �artir de vider groupe
	$text1=str_replace("|",",",$text);
	$tab = explode(",",$text1); 
	$text2=count($tab);
	for ($i=0; $i<$text2 and $text2!=0; $i++){
		if ($tab[$i]!='') CBdd::execute("DELETE FROM user WHERE id = " . $tab[$i]);
		else $not=1;
	}
	$tgroupe->update();
	if ($not!=1) $msginfo = "groupe bien vid&eacute;";
	$a = 0;
	break;
case 5555://confirmer
	if(!empty($_GET['id'])) $id = $_GET['id'];
开发者ID:rakotobe,项目名称:Rakotobe,代码行数:31,代码来源:groupe.php


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