<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1022283" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1022283</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/foreachloop-going-8-times-expected#comment-1137387</link>
    <description> &lt;p&gt;i use * because i use each part of the feild. it works perfectly now. thanks.&lt;/p&gt;
 </description>
     <pubDate>Sat, 06 Sep 2003 22:10:16 +0000</pubDate>
 <dc:creator>m3rajk</dc:creator>
 <guid isPermaLink="false">comment 1137387 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/foreachloop-going-8-times-expected#comment-1137380</link>
    <description> &lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;$friendfind &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;mysql_query&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(\&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;SELECT * FROM friends WHERE uid=&#039;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$uin&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;\&quot;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$db&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;); # get friends&lt;br /&gt;if(mysql_num_rows(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$friendfind&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;)==0) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$ferr&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;=&#039;&amp;lt;h1&amp;gt;No Desires/Lusts Found&amp;lt;/h1&amp;gt;&#039;; # error on getting friends&lt;br /&gt;}&lt;br /&gt;else { # get the desires&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$ppl&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;=mysql_num_rows(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$friendfind&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;); # how many friends?&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$debug&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;.=\&quot;ppl : &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$ppl&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$i&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;=0;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$i&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$ppl&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$i&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;++) { # for each friend&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$debug&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; .= &#039;&amp;lt;br /&amp;gt;fetching desire&#039;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$desired&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[]&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = mysql_fetch_array(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$friendfind&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;); # get the info&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$desired&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; as &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$friend&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;) { # for each friend&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$debug&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; .= &#039;making desired&#039;; // debug line&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* break up the info */&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$fuid&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$friend&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;fuid&#039;]; // friend&#039;s user id&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$frnd&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$friend&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;fun&#039;]; // friend&#039;s username&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$cof&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$friend&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;cof&#039;];&amp;nbsp; // user&#039;s comment on friend&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$desires&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;.=\&quot;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;lt;input type=\\&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;checkbox&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;\\&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot; name=\\&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;delf&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[]\\&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;\&quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .\&quot;value=\\&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$fuid&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;\\&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;a href=\\&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;profile&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;php&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;?&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;un&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$frnd&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;\\&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;\&quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .\&quot;onClick=\\&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;alert&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;Your Comment on $frnd: $cof&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);\\&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;\&quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .\&quot;target=\\&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$frnd&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;\\&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$frnd&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&amp;lt;/a&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;\n\&quot;; # make the display&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;Your sucking the entire recordset into memory.  Not advised unless you need this data for later.&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;$friendfind &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;mysql_query&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(\&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;SELECT * FROM friends WHERE uid=&#039;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$uin&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;\&quot;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$db&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;); # get friends&lt;br /&gt;if(mysql_num_rows(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$friendfind&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;)==0) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$ferr&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;=&#039;&amp;lt;h1&amp;gt;No Desires/Lusts Found&amp;lt;/h1&amp;gt;&#039;; # error on getting friends&lt;br /&gt;}&lt;br /&gt;else { # get the desires&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$ppl&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;=mysql_num_rows(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$friendfind&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;); # how many friends?&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$debug&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;.=\&quot;ppl : &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$ppl&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$friend&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;=mysql_fetch_array(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$friendfind&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;)) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$debug&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; .= &#039;making desired&#039;; // debug line&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* break up the info */&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$fuid&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$friend&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;fuid&#039;]; // friend&#039;s user id&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$frnd&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$friend&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;fun&#039;]; // friend&#039;s username&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$cof&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$friend&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;cof&#039;];&amp;nbsp; // user&#039;s comment on friend&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$desires&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;.=\&quot;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;lt;input type=\\&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;checkbox&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;\\&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot; name=\\&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;delf&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[]\\&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;\&quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .\&quot;value=\\&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$fuid&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;\\&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;a href=\\&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;profile&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;php&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;?&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;un&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$frnd&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;\\&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;\&quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .\&quot;onClick=\\&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;alert&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;Your Comment on $frnd: $cof&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);\\&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;\&quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .\&quot;target=\\&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$frnd&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;\\&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$frnd&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&amp;lt;/a&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;\n\&quot;; # make the display&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
 </description>
     <pubDate>Sat, 06 Sep 2003 16:59:57 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1137380 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/foreachloop-going-8-times-expected#comment-1137376</link>
    <description> &lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;$friendfind&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;mysql_query&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(\&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;SELECT * FROM friends WHERE uid=&#039;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$uin&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;\&quot;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$db&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;); # get friends&lt;br /&gt;if(mysql_num_rows(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$friendfind&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;)==0){&lt;br /&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$ferr&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;=&#039;&amp;lt;h1&amp;gt;No Desires/Lusts Found&amp;lt;/h1&amp;gt;&#039;; # error on getting friends&lt;br /&gt;}else{ # get the desires&lt;br /&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$ppl&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;=mysql_num_rows(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$friendfind&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;); # how many friends?&lt;br /&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$debug&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;.=\&quot;ppl : &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$ppl&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;;&lt;br /&gt;&amp;nbsp; for(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$i&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;=0;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$i&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$ppl&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$i&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;++){ # for each friend&lt;br /&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$debug&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;.=&#039;&amp;lt;br /&amp;gt;fetching desire&#039;;&lt;br /&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$desired&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;=mysql_fetch_array(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$friendfind&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;); # get the info&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; /* previously posted code */&lt;br /&gt;}&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;that&#039;s is, with where the other code is&lt;/p&gt;
 </description>
     <pubDate>Sat, 06 Sep 2003 16:20:01 +0000</pubDate>
 <dc:creator>m3rajk</dc:creator>
 <guid isPermaLink="false">comment 1137376 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/foreachloop-going-8-times-expected#comment-1137356</link>
    <description> &lt;p&gt;From the 2nd quote, I can tell that your foreach() looping through a single record within a recordset.  How can I tell?  mysql_fetch_array() returns an array with both numeric and associative keys.  That&#039;s why everything is repeating itself twice.&lt;/p&gt;
&lt;p&gt;Copy &amp;amp; Paste the code that populates $desired.  $desired can&#039;t be an array of associative arrays.  It&#039;s simply the first record of the recordset.&lt;/p&gt;
 </description>
     <pubDate>Sat, 06 Sep 2003 02:53:47 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1137356 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
