<?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[Problemi con una funzione]]></title><description><![CDATA[<p dir="auto">Salve a tutti, ho un problema con una funzione php. A dire il vero non sono molto pratica con le funzioni e quindi è possibile che sbagli qualcosa.</p>
<p dir="auto">La funzione è la seguente</p>
<pre><code class="language-php">function start_graph($xml_graphics)
{
 $idAzione = $_GET['idAzione'];
 global $xml;
 $graphic = $xml_graphics-&gt;getObjById("graphic1");
 $ds = $xml-&gt;getObjById("ds1");
 $ds-&gt;ds-&gt;dsConnect();
 $ds-&gt;ds-&gt;dsQuery("SELECT * FROM `gantt` WHERE `idAzione`=\"$idAzione\" ORDER BY begin");
 $objtype = array(0=&gt;"plot",1=&gt;"title",2=&gt;"scale");
 $i=3;
 while ($row = $ds-&gt;ds-&gt;dsGetRow())
 {
     $objtype[$i] = "gantt";
     $type[$i]   = $row-&gt;type;
     $label[$i]   = $row-&gt;label;
     $begin[$i]   = $row-&gt;begin;
     $end[$i]   = $row-&gt;end;
     $i++;
 }
 $graphic-&gt;setProperty("objtype", $objtype);
 $graphic-&gt;setProperty("type", $type); 
 $graphic-&gt;setProperty("label", $label);
  $graphic-&gt;setProperty("start", $begin);
  $graphic-&gt;setProperty("end", $end);
}
</code></pre>
<p dir="auto">Il problema sta nel valore di $idAzione che utilizzo nella query. Questo valore non viene riconosciuto e difatti la query va in errore. Se invece sostituisco $idAzione con un valore fisso la query viene eseguita regolarmente.<br />
Ho controllato facendo un echo in precedenza e la variabile ha un suo valore, non è vuota. In che cosa sbaglio?</p>
]]></description><link>https://dev.connect.gt/topic/127805/problemi-con-una-funzione</link><generator>RSS for Node</generator><lastBuildDate>Sun, 29 Nov 2026 23:36:49 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/127805.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 19 May 2010 07:19:32 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Problemi con una funzione on Thu, 20 May 2010 09:30:15 GMT]]></title><description><![CDATA[<p dir="auto">E la funzione dove viene richiamata?</p>
]]></description><link>https://dev.connect.gt/post/912065</link><guid isPermaLink="true">https://dev.connect.gt/post/912065</guid><dc:creator><![CDATA[thedarkita]]></dc:creator><pubDate>Thu, 20 May 2010 09:30:15 GMT</pubDate></item><item><title><![CDATA[Reply to Problemi con una funzione on Thu, 20 May 2010 09:22:56 GMT]]></title><description><![CDATA[<p dir="auto">Eccolo</p>
<pre><code class="language-php">require_once("../jamp/class/system.class.php");
$system = new ClsSystem(true);
$xml   = new ClsXML("dynamic_gantt.xml");
$event = new ClsEvent($xml);
$event-&gt;managerRequest();
$idAzione = $_GET['idAzione'];
function start_graph($xml_graphics)
{
 $idAzione = $_GET['idAzione'];
 global $xml;
 $graphic = $xml_graphics-&gt;getObjById("graphic1");
 $ds = $xml-&gt;getObjById("ds1");
 $ds-&gt;ds-&gt;dsConnect();
 $ds-&gt;ds-&gt;dsQuery("SELECT * FROM `gantt` WHERE `idAzione`= $idAzione ORDER BY begin");
 $objtype = array(0=&gt;"plot",1=&gt;"title",2=&gt;"scale");
 $i=3;
 while ($row = $ds-&gt;ds-&gt;dsGetRow())
 {
     $objtype[$i] = "gantt";
     $type[$i]   = $row-&gt;type;
     $label[$i]   = $row-&gt;label;
     $begin[$i]   = $row-&gt;begin;
     $end[$i]   = $row-&gt;end;
     $i++;
 }
 $graphic-&gt;setProperty("objtype", $objtype);
 $graphic-&gt;setProperty("type", $type); 
 $graphic-&gt;setProperty("label", $label);
  $graphic-&gt;setProperty("start", $begin);
  $graphic-&gt;setProperty("end", $end);
}
</code></pre>
]]></description><link>https://dev.connect.gt/post/912068</link><guid isPermaLink="true">https://dev.connect.gt/post/912068</guid><dc:creator><![CDATA[freebreathe]]></dc:creator><pubDate>Thu, 20 May 2010 09:22:56 GMT</pubDate></item><item><title><![CDATA[Reply to Problemi con una funzione on Thu, 20 May 2010 08:20:09 GMT]]></title><description><![CDATA[<p dir="auto">Posta lo script per intero...</p>
]]></description><link>https://dev.connect.gt/post/912062</link><guid isPermaLink="true">https://dev.connect.gt/post/912062</guid><dc:creator><![CDATA[thedarkita]]></dc:creator><pubDate>Thu, 20 May 2010 08:20:09 GMT</pubDate></item><item><title><![CDATA[Reply to Problemi con una funzione on Thu, 20 May 2010 06:06:07 GMT]]></title><description><![CDATA[<p dir="auto">Se questo comando lo scrivo prima della funzione, mi restituisce</p>
<pre><code class="language-php">Array ([idAzione] =&gt; 31)
</code></pre>
<p dir="auto">Se lo scrivo dentro la funzione non mi restituisce nulla.</p>
]]></description><link>https://dev.connect.gt/post/912067</link><guid isPermaLink="true">https://dev.connect.gt/post/912067</guid><dc:creator><![CDATA[freebreathe]]></dc:creator><pubDate>Thu, 20 May 2010 06:06:07 GMT</pubDate></item><item><title><![CDATA[Reply to Problemi con una funzione on Wed, 19 May 2010 13:49:13 GMT]]></title><description><![CDATA[<p dir="auto">Bisogna vedere com'è richiamata quella funzione...<br />
Metti all'interno della funzione:</p>
<pre><code class="language-php">print_r($_GET);
</code></pre>
<p dir="auto">E incolla qua l'array mostrato.</p>
]]></description><link>https://dev.connect.gt/post/912059</link><guid isPermaLink="true">https://dev.connect.gt/post/912059</guid><dc:creator><![CDATA[thedarkita]]></dc:creator><pubDate>Wed, 19 May 2010 13:49:13 GMT</pubDate></item><item><title><![CDATA[Reply to Problemi con una funzione on Wed, 19 May 2010 13:41:48 GMT]]></title><description><![CDATA[<p dir="auto">Si è presente. Infatti se provo a visualizzarlo prima della funzione, il valore di idAzione è corretto</p>
]]></description><link>https://dev.connect.gt/post/912076</link><guid isPermaLink="true">https://dev.connect.gt/post/912076</guid><dc:creator><![CDATA[freebreathe]]></dc:creator><pubDate>Wed, 19 May 2010 13:41:48 GMT</pubDate></item><item><title><![CDATA[Reply to Problemi con una funzione on Wed, 19 May 2010 13:39:20 GMT]]></title><description><![CDATA[<p dir="auto">Ciao freebreathe,</p>
<p dir="auto">nell'url da cui richiami la pagina, la variabile get è presente?</p>
]]></description><link>https://dev.connect.gt/post/912058</link><guid isPermaLink="true">https://dev.connect.gt/post/912058</guid><dc:creator><![CDATA[thedarkita]]></dc:creator><pubDate>Wed, 19 May 2010 13:39:20 GMT</pubDate></item></channel></rss>