<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Errore MySQL ricerca su più tabelle]]></title><description><![CDATA[<p dir="auto">Salve,<br />
ho creato un modulo di ricerca in cui le variabili sono dichiarate così:</p>
<pre><code class="language-php">    #Parametri ricerca
    var $fulltext = "Modello,Descrizione";
    var $table = "day_processori, day_harddisk";
</code></pre>
<p dir="auto">day_processori e day_harddisk sono due tabelle del db (in futuro ne vorrei aggiungere altre).</p>
<p dir="auto">Mentre la funzione di ricerca è la seguente:</p>
<pre><code class="language-php">function GetResource()
        {
            $this-&gt;DbConnectAndSelect();
            $sql = "SELECT * MATCH($this-&gt;fulltext) AGAINST('$this-&gt;key' IN BOOLEAN MODE) AS tot FROM $this-&gt;table WHERE MATCH($this-&gt;fulltext) AGAINST('$this-&gt;key' IN BOOLEAN MODE) ORDER BY tot DESC";
            $this-&gt;res = mysql_query($sql, $this-&gt;conn);
            //print $sql;
            //die;
            
        }
</code></pre>
<p dir="auto">Ciò che dovrebbe restituirmi il risultato è il codice seguente (linea 114):</p>
<pre><code class="language-php">$search-&gt;GetResource();
while ($row = mysql_fetch_array($search-&gt;res))
</code></pre>
<p dir="auto">Tuttavia ottengo questo errore:</p>
<pre><code>[B]Warning[/B]:  mysql_fetch_array(): supplied argument is not a valid MySQL result resource in [B]C:\...\cerca.php[/B] on line [B]114[/B]
</code></pre>
<p dir="auto">Un print sulla query mi ha restituito:</p>
<pre><code>SELECT * MATCH(Modello,Descrizione) AGAINST('maxtor' IN BOOLEAN MODE) AS tot FROM day_processori, day_harddisk WHERE MATCH(Modello,Descrizione) AGAINST('maxtor' IN BOOLEAN MODE) ORDER BY tot DESC
</code></pre>
<p dir="auto">Le due tabelle hanno campi diversi, tranne Modello e Descrizione che esistono in entrambe.<br />
Dove sto sbagliando??</p>
<p dir="auto">Grazie,<br />
S.</p>
]]></description><link>https://dev.connect.gt/topic/84689/errore-mysql-ricerca-su-più-tabelle</link><generator>RSS for Node</generator><lastBuildDate>Thu, 26 Nov 2026 05:37:31 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/84689.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 08 Oct 2008 09:35:01 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Errore MySQL ricerca su più tabelle on Thu, 09 Oct 2008 12:59:30 GMT]]></title><description><![CDATA[<p dir="auto">Trattandosi di operazioni su due tabelle, prova a cambiere i tag <em>&lt;campo&gt;</em> della query con i tag <em>&lt;tabella&gt;.&lt;campo&gt;</em>.<br />
Altra cosa, le tabelle su cui esegui il matching hanno un indice full-text?</p>
<p dir="auto">Ciao!</p>
]]></description><link>https://dev.connect.gt/post/766778</link><guid isPermaLink="true">https://dev.connect.gt/post/766778</guid><dc:creator><![CDATA[sups]]></dc:creator><pubDate>Thu, 09 Oct 2008 12:59:30 GMT</pubDate></item><item><title><![CDATA[Reply to Errore MySQL ricerca su più tabelle on Thu, 09 Oct 2008 12:10:49 GMT]]></title><description><![CDATA[<p dir="auto">c'è una relazione tra le due tabelle? i campi modello e descrizione ci sono in entrambe le tabelle?</p>
]]></description><link>https://dev.connect.gt/post/766790</link><guid isPermaLink="true">https://dev.connect.gt/post/766790</guid><dc:creator><![CDATA[luigi 0]]></dc:creator><pubDate>Thu, 09 Oct 2008 12:10:49 GMT</pubDate></item><item><title><![CDATA[Reply to Errore MySQL ricerca su più tabelle on Thu, 09 Oct 2008 10:29:29 GMT]]></title><description><![CDATA[<p dir="auto">Grazie per il consiglio, ma l'INNER JOIN lo dovrei inserire tra il richiamo alle due tabelle del db?</p>
]]></description><link>https://dev.connect.gt/post/766789</link><guid isPermaLink="true">https://dev.connect.gt/post/766789</guid><dc:creator><![CDATA[pepozzo]]></dc:creator><pubDate>Thu, 09 Oct 2008 10:29:29 GMT</pubDate></item><item><title><![CDATA[Reply to Errore MySQL ricerca su più tabelle on Thu, 09 Oct 2008 09:46:53 GMT]]></title><description><![CDATA[<p dir="auto">credo che l'errore stia nel mancato uso dell'inner join, inoltre dovresti mettere la segnalazione dell'errore anche sulla query visto che probabilmente il problema sta lì</p>
]]></description><link>https://dev.connect.gt/post/766791</link><guid isPermaLink="true">https://dev.connect.gt/post/766791</guid><dc:creator><![CDATA[luigi 0]]></dc:creator><pubDate>Thu, 09 Oct 2008 09:46:53 GMT</pubDate></item><item><title><![CDATA[Reply to Errore MySQL ricerca su più tabelle on Thu, 09 Oct 2008 09:19:26 GMT]]></title><description><![CDATA[<p dir="auto">Ciao e grazie per la risposta!</p>
<p dir="auto">Tuttavia niente da fare...Sempre lo stesso errore.</p>
<p dir="auto">Altre soluzioni?</p>
]]></description><link>https://dev.connect.gt/post/766792</link><guid isPermaLink="true">https://dev.connect.gt/post/766792</guid><dc:creator><![CDATA[pepozzo]]></dc:creator><pubDate>Thu, 09 Oct 2008 09:19:26 GMT</pubDate></item><item><title><![CDATA[Reply to Errore MySQL ricerca su più tabelle on Wed, 08 Oct 2008 14:33:42 GMT]]></title><description><![CDATA[<p dir="auto">Prova ad utilizzare questa query, in particolare con la virgola dopo l'asterisco.</p>
<p dir="auto">SELECT *, MATCH(...</p>
<p dir="auto">Ciao!</p>
]]></description><link>https://dev.connect.gt/post/766777</link><guid isPermaLink="true">https://dev.connect.gt/post/766777</guid><dc:creator><![CDATA[sups]]></dc:creator><pubDate>Wed, 08 Oct 2008 14:33:42 GMT</pubDate></item></channel></rss>