eccomi qui.. scusa il ritardo ma son tornato ora...
allora, lo script è questo:
codice:
function DbConnectAndSelect()
{
$this->conn = @mysql_connect($this->host, $this->user, $this->password) or die ("Impossibile stabilire una connessione con il server.
MySql risponde: " . mysql_error() . "
Il codice errore é:" . mysql_errno());
@mysql_select_db($this->db, $this->conn) or die ("Impossibile connettersi al database $this->db.
MySql risponde: " . mysql_error() . "
Il codice errore é:" . mysql_errno());
mysql_query('set names utf8');
}
function GetResource()
{
$this->DbConnectAndSelect();
$sql = "SELECT *, MATCH($this->fulltext) AGAINST('$this->key' IN BOOLEAN MODE) AS tot FROM $this->table WHERE MATCH($this->fulltext) AGAINST('$this->key' IN BOOLEAN MODE) ORDER BY tot DESC";
$this->res = mysql_query($sql, $this->conn);
echo $sql;
}
Mentre invece il valore lo passo normalmente cosi
codice:
$key = $_POST['search'];
$search = new Search($key);
$search->GetResource();
while ($row = mysql_fetch_array($search->res))
{
echo "<h2><a href=\"dettaglio_film.php?id_dvd=".$row['id_dvd']."\">".$row['titolo']."</a>" . " (score: " . $search->CalcScore($row['tot']).")</h2>";
}
?>
POI, il db ha fulltext su quel campo e come tipo lìintero DB è myISAM...