Commit 788ff3d7 authored by Charles DORMEVAL's avatar Charles DORMEVAL
Browse files

ajout de la partie moteur de recherche + modelebd

parent 8a9ac6ea
......@@ -30,7 +30,7 @@ function suppr_accents($str, $encoding='utf-8')
$fichier="../../data/testCitations.txt";
$fichier="../../data/Toutes.txt";
$handle=fopen($fichier,"r");
$content=fread($handle,filesize($fichier));
$split=explode("\n",$content); //on separe pour chaque saut de ligne
......
......@@ -43,17 +43,18 @@ foreach ($pre_citations as $courant){
/*------BDD-PARTIE2-PRE-------------*/
try{
$bdd = new PDO('mysql:host=localhost;dbname=projet_citations;charset=utf8', 'root', '');
$bdd = new PDO('mysql:host=localhost;dbname=projet;charset=utf8', 'root', '');
}catch(Exception $e){
die('Erreur : '.$e->getMessage());
}
for($i=0;$i<=200000;$i++){
if($citationtableau[$i]!=""){
$req=$bdd->prepare("insert into citations_pre(id_citations, contenu) values(:id_citations, :contenu)");
$req=$bdd->prepare("insert into citations(id_citation, contenu, id_oeuvre) values(:id_citation, :contenu, :id_oeuvre)");
$req->execute(array(
'id_citations'=>$i,
'contenu'=>$citationtableau[$i]
'id_citation'=>$i,
'contenu'=>$citationtableau[$i],
'id_oeuvre'=>$i
));
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment