pdo->prepare("SELECT like_count, dislike_count FROM t_".$_POST['ref']." WHERE id_".$_POST['ref_id']." = ?"); $req->execute(array($_POST['ref_id'])); header('Content-type: application/json'); $record = $req->fetch(PDO
pdo->prepare($sql); $query->bindParam(':keyword', $keyword, PDO::PARAM_STR); $query->execute(); $list = $query->fetchAll(); foreach ($list as $rs) { // put in bold the written text $title = str_replace(htmlspecialchars($_POST
PDO::MYSQL\_ATTR\_INIT\_COMMAND => "SET NAMES utf8"); return $base = new PDO('mysql:host='.$PARAM\_hote.';dbname='.$PARAM\_nom\_bd, $PARAM\_utilisateur, $PARAM\_mot\_passe, $PARAM\_set ); } catch ( Exception $e ) { die('Impossible
pdo->prepare("INSERT INTO t_commentaire SET content_commentaire = ?, ref = ?, ref_id = ?, add_user = ?, date_commentaire = ?"); $req->execute(array($_POST['content_commentaire'], $ref, $ref_id, $_SESSION['auth']->id_user, $date
PDO('mysql:host=localhost;dbname=monappli;port=3308;charset=utf8','root',''); $bdd->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } catch (Exception $e) { die('Erreur : '. $e->getMessage()); } voici le code de connexion
pdo = new PDO('mysql:host='.$conf['host'].';dbname='.$conf['database'].';'.$conf['login'].$conf['password']); Model::$connections[$this->db] = $pdo; }catch(PDOException $e){ if(Conf::$debug >= 1){ die($e->getMessage()); }else
PDO("mysql:host=localhost;dbname=diretasz_kipt","root",""); $myconn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $myconn->exec('set names utf8'); }catch(PDOExeption $e){ echo ' alert("Probleme de connexion, erreur ->'.$e->getMessage().'") '; } ?> ### Ce que je fais ``` Entourez
PDO('mysql:host=localhost;dbname=test;charset=utf8', 'root', ''); echo 'Connection réussit'; } catch (Exception $e) { die('Erreur : ' . $e->getMessage()); } var_dump($bdd); $bddInfos = $bdd->prepare("SELECT * FROM infos"); $bddExes = $bddInfos
PDO::FETCH_OBJ)) { echo "---pilodid_cil---".$cil->pilotid; } $sql2="SELECT `pilotid` FROM `enr_mil_pilots` WHERE `email` LIKE '%$forum->user_email%'"; $req2 = $DBPDO5 ->query($sql2); while($mil=$req2->fetch(PDO
PDO('mysql:host=localhost;dbname=dbprotect', 'root', ''); $bdd->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);; } catch (Exception $e) { die('Erreur : ' . $e->getMessage()); } if(isset($_SESSION['id_user'])) { $req= $bdd->prepare