Bonjour à tous, oui encore moi

donc voilà
j'ai récuperer une source sur internet pour un moteur de recherche à l'interne d'une base sql, apparament il est très fonctionnel et plus que le script que j'vaias moi même programmer avant...

mais voilà j'ai un problémes , une erreur même :
Parse error: syntax error, unexpected T_VARIABLE in /home/chm2/www/recherche/recherche.php on line 148

ligne 148 :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
$result = mysql_query($sql['select']); // si erreur
voici la page recherche.php :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
<?php
class dbSearch
{
// mots et expressions à chercher
private $words;
 // séparateur
 private $sep;
 
 // option de recherche
 private $option;
 
// nombre de mots
 private $count_words;
 
// clause where
 private $query_where = '';
 
 /*
 __construct()
 Paramètres:
 - $search_option: option choisie
 - $search_text: texte de recherche entré
 Retour:
 void
 */
public function __construct( $search_option, $search_text )
 {
 $this->query_prepared = 1;
 
 // option de recherche
 $this->option = $search_option;
 
 // recherche en ET
 if( $this->option == 'all' )
 {
 $this->sep = ' AND ';
 $this->option = 1;
 $this->words = explode( ' ', addslashes( $search_text ) );
 $this->count_words = count( $this->words );
 }
 // recherche en OU
 else if( $this->option == 'one' )
 {
 $this->sep = ' OR ';
 $this->option = 2;
 $this->words = explode( ' ', addslashes( $search_text ) );
 $this->count_words = count( $this->words );
 }
 // phrase exacte
 else
 {
 $this->option = 0;
 $this->words[0] = addslashes( $search_text );
 }
 }
 
 /*
 mkQuery()
 Crée la requête MySQL
 Paramètres:
 - $table ( string ): table à utiliser
 - $select ( string ): les champs que l'on récupère
 - $champs ( string si 1 champ, array si plusieurs ): champs dans lesquels s'effectue la recherche
 - $order ( string ): critère de classement ; pas de classement si vide
 - $sens ( string: asc ou desc ): sens du classement
 - $limit_start ( entier ): pour le LIMIT
 - $limit_nb ( entier ): pour le LIMIT ; si 0, pas de clause LIMIT
 Retour:
 void
 */
 public function mkQuery( $table, $select, $champs, $order, $sens, $limit_start, $limit_nb )
 {
 $this->query_where = '';
 
 if( !is_array( $champs ) )
 $champs = array( $champs );
 
 $count_champs = count( $champs );
 
 // si recherche en ET ou OU
 if( $this->option )
 {
 for( $i = 0; $i < $this->count_words; $i++ ) // boucle sur les mots
 {
 // si pas première itération
 if( $i )
 $this->query_where .= $this->sep;
 
 $this->query_where .= '( ';
 
 for( $j = 0; $j < $count_champs; $j++ ) // boucle sur les champs
 {
 if( $j )
 $this->query_where .= ' OR ';
 
 $this->query_where .= $champs[ $j ] . ' LIKE \'%' . $this->words[ $i ] . '%\'';
 
 } // for( $j = 0; $j < $this->count_words; $j++ ) // boucle sur les champs
 
 $this->query_where .= ' )';
 } // for( $i = 0; $i < $count_champs; $i++ ) // boucle sur les mots
 }
 else // recherche phrase exacte
 {
 for( $i = 0; $i < $count_champs; $i++ ) // boucle sur les champs
 {
 if( $i )
 $this->query_where .= ' OR ';
 
 $this->query_where .= $champs[$i] . ' LIKE \'%' . $this->words[0] . '%\' ';
 } // for( $i = 0; $j < $count_champs; $i++ ) // boucle sur les champs
 } // else // recherche phrase exacte
 
 // construction de la requête finale
 $sql = array( 'select' => 'SELECT ' . $select . ' FROM ' . $table . ' WHERE ' . $this->query_where, 'count' => 'SELECT count(*) FROM ' . $table . ' WHERE ' . $this->query_where );
 
 if( !empty( $order ) )
 $sql['select'] .= ' ORDER BY ' . $order . ' ' . $sens;
 $this->query_where = $sql['select'];
 if( $limit_nb )
 $sql['select'] .= ' LIMIT ' . $limit_start . ', ' . $limit_nb;
 
 return $sql;
 }
 
 /*
 getWhere()
 Récupération de la clause where
 Paramètres:
 void
Retour:
 string
 */
public function getQuery()
{
return $this->query_where;
}
}
?>
 
<?php
	include_once './mysql.inc';
	connexion_DB('BASE_TEST');
 
 
$s = new dbSearch( $_POST['search_option'], $_POST['search_text'] );
$sql = $s->mkQuery( 'news', 'id', array( 'titre', 'content' ), 'id', 'desc', 0, 10 )
$result = mysql_query($sql['select']); // si erreur
 
while( $row = mysql_fetch_assoc( $result ) )
{
  // affichage normal ici (titre et texte récupérés), genre:
  echo 'Titre: ' , stripslashes( $row['titre'] ) , '<br />' , stripslashes( $row['content'] ) , '<br /><hr />';
}
 
?>
la page recherche.html

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>
 
<body>
<form action="recherche	.php" method="post">
<input type="text" name="search_text" size="100" style="font-size: 12px;" value=""><br><br>
<input type="radio" name="search_option" value="all" style="border: none; font-size: 12px;" checked>Rechercher tous les mots<br>
<input type="radio" name="search_option" value="one" style="border: none; font-size: 12px;">Rechercher un de ces mots<br>
<input type="radio" name="search_option" value="sentence" style="border: none; font-size: 12px;">Rechercher l'expression exacte
 
<br><br>
<input type="submit" value="Rechercher" name="submit" style="font-size: 12px; position: relative; left: 20px;">
</form>
</body>
</html>
voilà vous avez le tout, mais je ne trouve pas l'erreur, d'ou elleprovient,...

encore merci à tous