<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Les forums de JeBulle.net – Nombre D&#39;enregistrement Dans Mysql]]></title>
	<link rel="self" href="https://forums.jebulle.net/feed/atom/topic/374/" />
	<updated>2004-07-18T17:28:20Z</updated>
	<generator>PunBB</generator>
	<id>https://forums.jebulle.net/topic/374/nombre-d39enregistrement-dans-mysql/</id>
		<entry>
			<title type="html"><![CDATA[Re: Nombre D&#39;enregistrement Dans Mysql]]></title>
			<link rel="alternate" href="https://forums.jebulle.net/post/5232/#p5232" />
			<content type="html"><![CDATA[<p>Bon je viens de regarder et chez moi ça fonctionne nikel &amp;#33;&amp;#33; <br />J&amp;#39;ai 9 tuples et le mysql_num_rows me retourne bien 9 ... <br /></p><div class="codebox"><pre><code>mysql_connect&amp;#40;&amp;#39;127.0.0.1&amp;#39;, &amp;#39;root&amp;#39;, &amp;#39;&amp;#39;&amp;#41;;
mysql_select_db&amp;#40;&amp;#39;test&amp;#39;&amp;#41;;
&amp;#036;res = mysql_query&amp;#40;&amp;#39;
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SELECT DISTINCT &amp;#40;p.id_personne&amp;#41;, p.nom_personne, p.prenom_personne 
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;FROM personnes p 
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;RIGHT JOIN interresses i 
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ON i.id_personne = p.id_personne;&amp;#39;&amp;#41;;

&amp;#036;i=1;
while &amp;#40; &amp;#036;data = mysql_fetch_array&amp;#40;&amp;#036;res&amp;#41; &amp;#41; {
 &amp;nbsp; &amp;nbsp;echo&amp;#40;&amp;#39;Tuple #&amp;#39;.&amp;#036;i.&amp;#39; --&amp;#62; &amp;#39;.&amp;#036;data&amp;#91;&amp;#39;id_personne&amp;#39;&amp;#93;.&amp;#39; &amp;#58; &amp;#39;.&amp;#036;data&amp;#91;&amp;#39;nom_personne&amp;#39;&amp;#93;.&amp;#39; &amp;#58; &amp;#39;.&amp;#036;data&amp;#91;&amp;#39;prenom_personne&amp;#39;&amp;#93;.&amp;#39;&amp;#60;br /&amp;#62;&amp;#39;&amp;#41;;
 &amp;nbsp; &amp;nbsp;&amp;#036;i++;
}

echo&amp;#40;mysql_num_rows&amp;#40;&amp;#036;res&amp;#41;&amp;#41;;</code></pre></div><p>Donc en fait je ne sais pas comment c&amp;#39;est possible ton truc <img src="https://forums.jebulle.net/img/smilies/wink.png" width="15" height="15" alt="wink" /></p><p>PS : ça fonctionne aussi avec une jointure à la &quot;Oracle&quot;<br />&lt;!--sql--&gt;&lt;/div&gt;&lt;table border=&#039;0&#039; align=&#039;center&#039; width=&#039;95%&#039; cellpadding=&#039;3&#039; cellspacing=&#039;1&#039;&gt;&lt;tr&gt;&lt;td&gt;<strong>SQL</strong> &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td id=&#039;CODE&#039;&gt;&lt;!--sql1--&gt;[color=blue;font-weight:bold]SELECT[/color] <span style="color: green">DISTINCT</span> (p.id_personne), p.nom_personne, p.prenom_personne <br /><span style="color: green">FROM</span> <span style="color: orange">personnes</span> p, interresses i<br /><span style="color: green">WHERE</span> i.id_personne <span style="color: orange">=</span> p.id_personne;&amp;#39;); &lt;!--sql2--&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;div class=&#039;postcolor&#039;&gt;&lt;!--sql3--&gt;</p>]]></content>
			<author>
				<name><![CDATA[Cyberbob002]]></name>
				<uri>https://forums.jebulle.net/user/5/</uri>
			</author>
			<updated>2004-07-18T17:28:20Z</updated>
			<id>https://forums.jebulle.net/post/5232/#p5232</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Nombre D&#39;enregistrement Dans Mysql]]></title>
			<link rel="alternate" href="https://forums.jebulle.net/post/5230/#p5230" />
			<content type="html"><![CDATA[<p>Voila mon probleme ou plutot mon interrogation:</p><p>J&amp;#39;ai 2 tables ( personnes et interresses ) qui sont relié par le champ id_personne.</p><p>Voici la requette que j&amp;#39;ai executé :</p><p>&lt;!--sql--&gt;&lt;/div&gt;&lt;table border=&#039;0&#039; align=&#039;center&#039; width=&#039;95%&#039; cellpadding=&#039;3&#039; cellspacing=&#039;1&#039;&gt;&lt;tr&gt;&lt;td&gt;<strong>SQL</strong> &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td id=&#039;CODE&#039;&gt;&lt;!--sql1--&gt;[color=blue;font-weight:bold]Select[/color] distinct(inte.id_personne), pers.nom_personne <br /><span style="color: green">from</span> <span style="color: orange">personnes</span> <span style="color: green">as</span> pers , interresses <span style="color: green">as</span> inte <br /><span style="color: green">where</span> pers.id_personne<span style="color: orange">=</span>inte.id_personne;<br />&lt;!--sql2--&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;div class=&#039;postcolor&#039;&gt;&lt;!--sql3--&gt;</p><p>Le probleme est que sous mysql&nbsp; lors de l&amp;#39;execution le resultat retourné par mysql est bon sauf le nombre d&amp;#39;enregistrement qui est superieur (il est egale a la meme requete sans le distinct).&nbsp; :blink: :blink: :blink: </p><p>Le mysql_num_rows renvoie aussi une info erroné mais pas un count du distinct. </p><p>Pour résoudre le probleme j&amp;#39;ai fais dans un premier temps un &quot;group by&quot; puis j&amp;#39;ai laisser&nbsp; le distinct et fais un count.</p><p>Si quelqu&amp;#39;un a une explication ou bien me fais prendre conscience d&amp;#39;une erreur envoyé je suis prenneur&nbsp; <img src="https://forums.jebulle.net/img/smilies/smile.png" width="15" height="15" alt="smile" />&nbsp; &nbsp; &nbsp;<img src="https://forums.jebulle.net/img/smilies/big_smile.png" width="15" height="15" alt="big_smile" /></p>]]></content>
			<author>
				<name><![CDATA[Sylnic]]></name>
				<uri>https://forums.jebulle.net/user/36/</uri>
			</author>
			<updated>2004-07-15T19:13:11Z</updated>
			<id>https://forums.jebulle.net/post/5230/#p5230</id>
		</entry>
</feed>
