本文整理汇总了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]);
}