<?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[problema con is_array]]></title><description><![CDATA[<p dir="auto">ciao in questo file prima cerco le idcategorie scelte e poi tutte le idcategorie presente nel tab del db. e stampo ok se sono uguali no se sn diverse,</p>
<p dir="auto">ma mi da questo problema e non sò però se il codice è giusto.</p>
<p dir="auto"><strong>Warning</strong>:  in_array() [<a href="http://localhost/componente/function.in-array" rel="nofollow ugc">function.in-array</a>]: Wrong datatype for second argument in <strong>C:\xampp\htdocs\componente\formmodificaprofilo.php</strong> on line <strong>50</strong></p>
<p dir="auto"><strong>```</strong><br />
<strong>&lt;?php</strong><br />
<strong>//Includo i file per la connessione</strong><br />
<strong>//e per la verifica Utente</strong><br />
<strong>require_once('connessione.php');</strong><br />
<strong>require_once('verificalogin.php');</strong><br />
<strong>?&gt;</strong><br />
<strong>&lt;html&gt;</strong><br />
<strong>&lt;head&gt;</strong><br />
<strong>&lt;/head&gt;</strong><br />
<strong>&lt;body&gt;</strong><br />
<strong>&lt;h1&gt; &lt;/h1&gt;</strong><br />
<strong>&lt;form action="creaprofilo.php" method="post" &gt;</strong><br />
<strong>&lt;?php</strong></p>
<p dir="auto"><strong>if(isset($_SESSION['utente'])){</strong></p>
<p dir="auto"><strong>$user=$_SESSION['utente'][0];</strong><br />
<strong>//echo $user;</strong><br />
<strong>}</strong><br />
<strong>else{</strong><br />
<strong>echo "errore utente";</strong><br />
<strong>}</strong></p>
<pre><code> **$query1 = "SELECT * FROM utente WHERE username = '$user'";** 
 **$result1 = mysql_query($query1) or die("Errore nella query1:".mysql_error());** 
 **$row = mysql_fetch_assoc($result1);** 
 **$idutente = $row['idutente'];**
 
 
 
 

**$query="select * from seleziona where idutente='$idutente'";**
**$result2 = mysql_query($query) or die("Errore nella query1:".mysql_error());** 
**$categorie_scelte= mysql_fetch_array($result2);**



**$query3="select idcategoria from categoria where idpadre='0' ";**
**$risultato=mysql_query($query3);**
**$numerorighe = mysql_num_rows($risultato);** 
</code></pre>
<p dir="auto"><strong>for($x=0; $x&lt;$numerorighe; $x++){</strong></p>
<p dir="auto"><strong>$tutte_categorie=mysql_fetch_array($risultato);</strong><br />
<strong>$idcategoria = $tutte_categorie['idcategoria'];</strong></p>
<pre><code>    **if(in_array($idcategoria, $categorie_scelte)){**
    
    **echo "ok";**
    
    **}**
    **else{**
    **echo "no";**
    
    **//}**
</code></pre>
<p dir="auto"><strong>}</strong><br />
<strong>}</strong></p>
<p dir="auto"><strong>?&gt;</strong><br />
<strong>&lt;input name="" type="submit"&gt;</strong><br />
<strong>&lt;/form&gt;</strong><br />
<strong>```</strong></p>
]]></description><link>https://dev.connect.gt/topic/22922/problema-con-is_array</link><generator>RSS for Node</generator><lastBuildDate>Wed, 25 Nov 2026 13:29:39 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/22922.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 07 Dec 2006 21:19:12 GMT</pubDate><ttl>60</ttl></channel></rss>