本文整理匯總了PHP中Connection::db_connect方法的典型用法代碼示例。如果您正苦於以下問題:PHP Connection::db_connect方法的具體用法?PHP Connection::db_connect怎麽用?PHP Connection::db_connect使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Connection
的用法示例。
在下文中一共展示了Connection::db_connect方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: view
public static function view($idUser)
{
$bdd = Connection::db_connect();
$req = $bdd->query('SELECT * FROM user WHERE id_user ="' . $idUser . '"');
$reponse = $req->fetchAll();
return $reponse ? $reponse : "erreur ou utilisateur non trouvé.";
}
示例2: Showproject
public function Showproject($name = "S1")
{
$pull_quote_atts = shortcode_atts(array('name' => 'S1'), $name);
$bdd = Connection::db_connect();
echo 'test';
$select = $bdd->prepare('SELECT * FROM startup where nom = ?');
$req = $bdd->execute($select, $name);
$ret = $req->fetchAll();
var_dump($ret);
return $ret;
}
示例3: ajoutExp
public static function ajoutExp($intitule, $date_debut, $date_fin, $description, $idUser)
{
$bdd = Connection::db_connect();
$req = $bdd->prepare("INSERT INTO CV_experience(intitule,date_debut,date_fin,description,id_user)\n\t\tVALUES (:intitule, :date_debut, :date_fin, :description, :idUser)");
$req->bindParam(':intitule', $intitule);
$req->bindParam(':date_debut', $date_debut);
$req->bindParam(':date_fin', $date_fin);
$req->bindParam(':description', $description);
$req->bindParam(':idUser', $idUser);
echo "test";
$req->execute();
}
示例4: delete
public static function delete($idUser)
{
$bdd = Connection::db_connect();
$req = $bdd->prepare('DELETE FROM user WHERE id_user=' . $idUser . '');
$req->execute();
}
示例5: findIdUserByNicename
public function findIdUserByNicename($nicename)
{
$bdd = Connection::db_connect();
$id_user = $bdd->query('SELECT * FROM wp_users where user_nicename = "' . $nicename . '"
OR user_login ="' . $nicename . '"');
$id_user = $id_user->fetchAll();
echo json_encode($id_user[0]);
}