<?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[mysql_fetch_array(): supplied argument is not a valid MySQL]]></title><description><![CDATA[<p dir="auto">Ho questo problema e non so proprio come risolvere:</p>
<p dir="auto">mysql_fetch_array(): supplied argument is not a valid MySQL result resource in ... line 81</p>
<p dir="auto">Questo è il codice:</p>
<pre><code class="language-php">&lt;table class="newlife-article" border="0" cellspacing="0" cellpadding="0" style="width:100%;"&gt;
                &lt;?
            $result=mysql_query("select * from products");
            while($row=mysql_fetch_array($result)){
        ?&gt;
    &lt;tbody&gt;
                 &lt;tr class="even"&gt;
            &lt;td style="width:97px;"&gt;&lt;?=$row['name']?&gt;&lt;/td&gt;
            &lt;td&gt;&lt;?=$row['description']?&gt;&lt;/td&gt;
            &lt;td style="text-align:center;width:77px;"&gt;
                &lt;table class="newlife-article" border="0" cellspacing="0" cellpadding="0" style="width:100%;"&gt;
                    &lt;tbody&gt;
                        &lt;tr class="even"&gt;
                            &lt;td style="border-top-width:3px;border-right-width:3px;border-bottom-width:3px;border-left-width:3px;"&gt;Dini&lt;/td&gt;
                            &lt;td style="border-top-width:3px;border-right-width:3px;border-bottom-width:3px;border-left-width:3px;"&gt;&lt;img width="14" height="14" alt="" src="/template/images/success-icon.png" style="border-top-width:0;border-right-width:0;border-bottom-width:0;border-left-width:0;margin:2px;" /&gt;&lt;br /&gt;&lt;/td&gt;
                        &lt;/tr&gt;
                               &lt;tr&gt;
                            &lt;td style="border-top-width:3px;border-right-width:3px;border-bottom-width:3px;border-left-width:3px;"&gt;Update&lt;/td&gt;
                            &lt;td style="border-top-width:3px;border-right-width:3px;border-bottom-width:3px;border-left-width:3px;"&gt;&lt;img width="14" height="14" alt="" src="/template/images/success-icon.png" style="border-top-width:0;border-right-width:0;border-bottom-width:0;border-left-width:0;margin:2px;" /&gt;&lt;br /&gt;&lt;/td&gt;
                        &lt;/tr&gt;
                    &lt;/tbody&gt;
                &lt;/table&gt;
                **
                &lt;br /&gt;
            &lt;/td&gt;
            &lt;td style="text-align:center;"&gt;
                &lt;table class="newlife-article" border="0" cellspacing="0" cellpadding="0" style="width:100%;"&gt;
                    &lt;tbody&gt;
                        &lt;tr class="even"&gt;
                            &lt;td style="text-align:center;width:97px;border-top-width:3px;border-right-width:3px;border-bottom-width:3px;border-left-width:3px;"&gt;&lt;span style="text-align:center;"&gt;&lt;span style="font-weight:bold;"&gt;&amp;#8364; &lt;?=$row['price']?&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/td&gt;
                        &lt;/tr&gt;
                        &lt;tr&gt;
                            &lt;td style="width:97px;border-top-width:3px;border-right-width:3px;border-bottom-width:3px;border-left-width:3px;"&gt;&lt;input type="button" value="Add to Cart" onclick="addtocart(&lt;?=$row['serial']?&gt;)" /&gt;&lt;/td&gt;
                        &lt;/tr&gt;
                    &lt;/tbody&gt;
                &lt;/table&gt;
            &lt;span style="color:#008800"&gt;01/04/2012&lt;/span&gt;    
            &lt;/td&gt;
        &lt;/tr&gt;
        &lt;? } ?&gt;
</code></pre>
<p dir="auto">Spero possiate aiutarmi.</p>
]]></description><link>https://dev.connect.gt/topic/167748/mysql_fetch_array-supplied-argument-is-not-a-valid-mysql</link><generator>RSS for Node</generator><lastBuildDate>Thu, 26 Nov 2026 08:14:51 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/167748.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 10 Mar 2012 20:06:04 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to mysql_fetch_array(): supplied argument is not a valid MySQL on Sun, 11 Mar 2012 12:56:03 GMT]]></title><description><![CDATA[<p dir="auto">Continua a non funzionare.</p>
<p dir="auto">Lo script originale è così:</p>
<pre><code>&lt;?
	include("includes/db.php");
	include("includes/functions.php");
	
	if($_REQUEST['command']=='add' &amp;&amp; $_REQUEST['productid']&gt;0){
		$pid=$_REQUEST['productid'];
		addtocart($pid,1);
		header("location:shoppingcart.php");
		exit();
	}
?&gt;

&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
&lt;title&gt;Products&lt;/title&gt;
&lt;script language="javascript"&gt;
	function addtocart(pid){
		document.form1.productid.value=pid;
		document.form1.command.value='add';
		document.form1.submit();
	}
&lt;/script&gt;
&lt;/head&gt;


&lt;body&gt;
&lt;form name="form1"&gt;
	&lt;input type="hidden" name="productid" /&gt;
    &lt;input type="hidden" name="command" /&gt;
&lt;/form&gt;
&lt;div align="center"&gt;
	&lt;h1 align="center"&gt;Products&lt;/h1&gt;
	&lt;table border="0" cellpadding="2px" width="600px"&gt;
		&lt;?
			$result=mysql_query("select * from products");
			while($row=mysql_fetch_array($result)){
		?&gt;
    	&lt;tr&gt;
        	&lt;td&gt;&lt;img src="&lt;?=$row['picture']?&gt;" /&gt;&lt;/td&gt;
            &lt;td&gt;   	&lt;b&gt;&lt;?=$row['name']?&gt;&lt;/b&gt;&lt;br /&gt;
            		&lt;?=$row['description']?&gt;&lt;br /&gt;
                    Price:&lt;big style="color:green"&gt;
                    	$&lt;?=$row['price']?&gt;&lt;/big&gt;&lt;br /&gt;&lt;br /&gt;
                    &lt;input type="button" value="Add to Cart" onclick="addtocart(&lt;?=$row['serial']?&gt;)" /&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
        &lt;tr&gt;&lt;td colspan="2"&gt;&lt;hr size="1" /&gt;&lt;/td&gt;
        &lt;? } ?&gt;
    &lt;/table&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
]]></description><link>https://dev.connect.gt/post/1058182</link><guid isPermaLink="true">https://dev.connect.gt/post/1058182</guid><dc:creator><![CDATA[heron]]></dc:creator><pubDate>Sun, 11 Mar 2012 12:56:03 GMT</pubDate></item><item><title><![CDATA[Reply to mysql_fetch_array(): supplied argument is not a valid MySQL on Sun, 11 Mar 2012 12:50:01 GMT]]></title><description><![CDATA[<p dir="auto">L'input è di tipo button, dovresti mettere submit.</p>
]]></description><link>https://dev.connect.gt/post/1058166</link><guid isPermaLink="true">https://dev.connect.gt/post/1058166</guid><dc:creator><![CDATA[thedarkita]]></dc:creator><pubDate>Sun, 11 Mar 2012 12:50:01 GMT</pubDate></item><item><title><![CDATA[Reply to mysql_fetch_array(): supplied argument is not a valid MySQL on Sun, 11 Mar 2012 10:48:06 GMT]]></title><description><![CDATA[<p dir="auto">Altro problema, quando clicco su "Add to cart" non va avanti, come se ci fosse un # invece dell'url. Nello script originale funziona. Metto il codice:</p>
<p dir="auto">&lt;script language="javascript"&gt;<br />
function addtocart(pid){<br />
document.form1.productid.value=pid;<br />
document.form1.command.value='add';<br />
document.form1.submit();<br />
}<br />
&lt;/script&gt;<br />
&lt;/head&gt;</p>
<p dir="auto">&lt;body&gt;<br />
&lt;? include('template/includes/pagepeel.inc.php'); ?&gt;<br />
&lt;? include('template/includes/login.inc.php'); ?&gt;<br />
&lt;? include('template/includes/menu.inc.php'); ?&gt;<br />
&lt;? include('template/includes/header.inc.php'); ?&gt;<br />
&lt;? include('template/includes/blocco.inc.php'); ?&gt;</p>
<pre><code>                  &lt;div class="cleared"&gt;&lt;/div&gt;
                &lt;/div&gt;
</code></pre>
<p dir="auto">&lt;table class="newlife-article" border="0" cellspacing="0" cellpadding="0" style="width:100%;"&gt;<br />
&lt;form name="form1"&gt;<br />
&lt;input type="hidden" name="productid" /&gt;<br />
&lt;input type="hidden" name="command" /&gt;<br />
&lt;/form&gt;<br />
&lt;?<br />
$result = mysql_query("SELECT * FROM products") or die(mysql_error());<br />
while($row=mysql_fetch_array($result)){<br />
?&gt;<br />
&lt;tbody&gt;<br />
&lt;tr class="even"&gt;<br />
&lt;td style="width:97px;"&gt;&lt;?=$row['name']?&gt;&lt;/td&gt;<br />
&lt;td&gt;&lt;?=$row['description']?&gt;&lt;/td&gt;<br />
&lt;td style="text-align:center;width:77px;"&gt;<br />
&lt;table class="newlife-article" border="0" cellspacing="0" cellpadding="0" style="width:100%;"&gt;<br />
&lt;tbody&gt;<br />
&lt;tr class="even"&gt;<br />
&lt;td style="border-top-width:3px;border-right-width:3px;border-bottom-width:3px;border-left-width:3px;"&gt;Dini&lt;/td&gt;<br />
&lt;td style="border-top-width:3px;border-right-width:3px;border-bottom-width:3px;border-left-width:3px;"&gt;&lt;img width="14" height="14" alt="" src="/template/images/success-icon.png" style="border-top-width:0;border-right-width:0;border-bottom-width:0;border-left-width:0;margin:2px;" /&gt;&lt;br /&gt;&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td style="border-top-width:3px;border-right-width:3px;border-bottom-width:3px;border-left-width:3px;"&gt;Update&lt;/td&gt;<br />
&lt;td style="border-top-width:3px;border-right-width:3px;border-bottom-width:3px;border-left-width:3px;"&gt;&lt;img width="14" height="14" alt="" src="/template/images/success-icon.png" style="border-top-width:0;border-right-width:0;border-bottom-width:0;border-left-width:0;margin:2px;" /&gt;&lt;br /&gt;&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/tbody&gt;<br />
&lt;/table&gt;<br />
**<br />
&lt;br /&gt;<br />
&lt;/td&gt;<br />
&lt;td style="text-align:center;"&gt;<br />
&lt;table class="newlife-article" border="0" cellspacing="0" cellpadding="0" style="width:100%;"&gt;<br />
&lt;tbody&gt;<br />
&lt;tr class="even"&gt;<br />
&lt;td style="text-align:center;width:97px;border-top-width:3px;border-right-width:3px;border-bottom-width:3px;border-left-width:3px;"&gt;&lt;span style="text-align:center;"&gt;&lt;span style="font-weight:bold;"&gt;€ &lt;?=$row['price']?&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td style="width:97px;border-top-width:3px;border-right-width:3px;border-bottom-width:3px;border-left-width:3px;"&gt;&lt;input type="button" value="Add to Cart" onclick="addtocart(&lt;?=$row['serial']?&gt;)" /&gt;&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/tbody&gt;<br />
&lt;/table&gt;<br />
&lt;span style="color:#008800"&gt;&lt;?=$row['scadenza']?&gt;&lt;/span&gt;	<br />
&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;? } ?&gt;</p>
]]></description><link>https://dev.connect.gt/post/1058178</link><guid isPermaLink="true">https://dev.connect.gt/post/1058178</guid><dc:creator><![CDATA[heron]]></dc:creator><pubDate>Sun, 11 Mar 2012 10:48:06 GMT</pubDate></item><item><title><![CDATA[Reply to mysql_fetch_array(): supplied argument is not a valid MySQL on Sun, 11 Mar 2012 10:35:02 GMT]]></title><description><![CDATA[<p dir="auto">Ecco che mi compare:</p>
<p dir="auto">Table 'test.products' doesn't exist</p>
<p dir="auto">Ma io non ricordo di aver aggiunto la parola test.</p>
<p dir="auto">--------------EDIT----------------</p>
<p dir="auto">Risolto, grazie mille per l'aiuto</p>
]]></description><link>https://dev.connect.gt/post/1058177</link><guid isPermaLink="true">https://dev.connect.gt/post/1058177</guid><dc:creator><![CDATA[heron]]></dc:creator><pubDate>Sun, 11 Mar 2012 10:35:02 GMT</pubDate></item><item><title><![CDATA[Reply to mysql_fetch_array(): supplied argument is not a valid MySQL on Sun, 11 Mar 2012 03:17:11 GMT]]></title><description><![CDATA[<p dir="auto">Ciao Heron,<br />
Hai fatto bene a non postare l'intero script perché sarebbe stato molto lungo, purtroppo però non possiamo dirti se c'è un problema perché manca la parte relativa alla connessione e selezione del database (il resto del codice infatti non sembra avere errori).</p>
<p dir="auto">Comunque, poiché quell'errore viene generato nel momento in cui la query non restituisce una risorsa mysql (e questo accade in caso di errore della mysql_query), puoi interrogare la funzione mysql_error(), che ti dice esattamente quale problema ha riscontrato.</p>
<p dir="auto">Per farlo è sufficiente sostituire a</p>
<pre><code class="language-php">$result=mysql_query("select * from products");
</code></pre>
<p dir="auto">Questo</p>
<pre><code class="language-php">$result = mysql_query("SELECT * FROM products") or die(mysql_error());
</code></pre>
<p dir="auto">Adesso, la funzione mysql_error andrà in errore restituendo i dettagli, che puoi postarci per capire meglio la situazione.</p>
<p dir="auto">A presto,<br />
Luca</p>
]]></description><link>https://dev.connect.gt/post/1058168</link><guid isPermaLink="true">https://dev.connect.gt/post/1058168</guid><dc:creator><![CDATA[lucabartoli]]></dc:creator><pubDate>Sun, 11 Mar 2012 03:17:11 GMT</pubDate></item></channel></rss>