<?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[funzione e query php]]></title><description><![CDATA[<p dir="auto">Salve a tutti,<br />
Dovrei far stampare il risultato di una query che si trova dentro una funzione... come posso fare ?<br />
Vi posto la mia funzione...</p>
<pre><code class="language-php">function seleziona_utente_collegato(){	$query = $dbh-&gt;prepare("SELECT  *  								FROM  utenti 								WHERE  stato = 'enabled'  AND idr = '$cookie';								LIMIT  0, 1");	// ESEGUO LA QUERY CON EXECUTE DI PDO	$query-&gt;execute();						// CONTROLLO SE HA TROVATO ALMENO 1 RIGA NEL DATABASE	$conta = $query-&gt;rowCount(); 						if($conta &gt; 0)	{  		//SCANSIONO IL RISULTATO SE HA TROVATO L'UTENTE		while($result = $query-&gt;fetch(PDO::FETCH_ASSOC))		{			$idr = $result['idr']; 			$nome = $result['nome'];  			$cognome = $result['cognome'];  			$email = $result['user'];  		}   	}}
</code></pre>
]]></description><link>https://dev.connect.gt/topic/218382/funzione-e-query-php</link><generator>RSS for Node</generator><lastBuildDate>Thu, 26 Nov 2026 03:58:26 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/218382.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 23 Oct 2015 19:58:56 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to funzione e query php on Mon, 26 Oct 2015 08:21:20 GMT]]></title><description><![CDATA[<p dir="auto">portesti salvarli in un array e fare un return dell'array</p>
]]></description><link>https://dev.connect.gt/post/1209851</link><guid isPermaLink="true">https://dev.connect.gt/post/1209851</guid><dc:creator><![CDATA[pietror]]></dc:creator><pubDate>Mon, 26 Oct 2015 08:21:20 GMT</pubDate></item><item><title><![CDATA[Reply to funzione e query php on Sun, 25 Oct 2015 09:19:20 GMT]]></title><description><![CDATA[<p dir="auto">ma se la variabile in cui salvo la query è all'interno della funzione, non vale per l'esterno lo stesso...</p>
]]></description><link>https://dev.connect.gt/post/1209848</link><guid isPermaLink="true">https://dev.connect.gt/post/1209848</guid><dc:creator><![CDATA[infosicurezza]]></dc:creator><pubDate>Sun, 25 Oct 2015 09:19:20 GMT</pubDate></item><item><title><![CDATA[Reply to funzione e query php on Sun, 25 Oct 2015 09:02:40 GMT]]></title><description><![CDATA[<p dir="auto">dovresti salvare il risultato della query in una variabile o in un array e successivamente stamparlo a video</p>
]]></description><link>https://dev.connect.gt/post/1209850</link><guid isPermaLink="true">https://dev.connect.gt/post/1209850</guid><dc:creator><![CDATA[pietror]]></dc:creator><pubDate>Sun, 25 Oct 2015 09:02:40 GMT</pubDate></item></channel></rss>