<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1047617" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1047617</link>
    <description></description>
    <language>en</language>
          <item>
    <title>Yeah, that does give me a</title>
    <link>https://www.webmaster-forums.net/web-programming-and-application-development/post-info#comment-1253427</link>
    <description> &lt;p&gt;Yeah, that does give me a jumping off place.  I was having a time figuring out how to insert the selected features into the association table.  This is very helpful.&lt;/p&gt;
&lt;p&gt;Thanks so very much! &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Fri, 10 Sep 2010 01:47:56 +0000</pubDate>
 <dc:creator>Dami</dc:creator>
 <guid isPermaLink="false">comment 1253427 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>You would loop through your</title>
    <link>https://www.webmaster-forums.net/web-programming-and-application-development/post-info#comment-1253426</link>
    <description> &lt;p&gt;You would loop through your features table, and generate all the checkboxes:&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;lt;input type=&amp;quot;checkbox&amp;quot; name=&amp;quot;features[1]&amp;quot; value=&amp;quot;1&amp;quot; /&amp;gt;4 wheel drive&lt;br /&gt;&amp;lt;input type=&amp;quot;checkbox&amp;quot; name=&amp;quot;features[2]&amp;quot; value=&amp;quot;1&amp;quot; /&amp;gt;Power steering &lt;br /&gt;&amp;lt;input type=&amp;quot;checkbox&amp;quot; name=&amp;quot;features[3]&amp;quot; value=&amp;quot;1&amp;quot; /&amp;gt;ABS&lt;br /&gt;...&lt;/code&gt;&lt;/div&gt;&lt;br /&gt;
Notice that the primary key of your features table is inside the brackets of the input name.&lt;/p&gt;
&lt;p&gt;When that form is submitted, you&#039;ll get $_POST[&#039;features&#039;] that is, itself, an array of all the form elements that were checked. So you would loop through them, and insert them into your Car-Features table:&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;$car_id &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= (int)&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;car_id&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;];&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;// delete all the old features&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;query&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;DELETE FROM CarFeatures WHERE car_id = &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$car_id&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;// loop through all the new features, and insert&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;foreach(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;features&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;] as &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$feature_id &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$v&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$feature_id &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= (int)&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$feature_id&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$sql &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;INSERT INTO CarFeatures(car_id, feature_id) VALUES(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$car_id&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$feature_id&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;)&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;query&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$sql&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;br /&gt;
Does that help?&lt;/p&gt;
 </description>
     <pubDate>Fri, 10 Sep 2010 00:27:40 +0000</pubDate>
 <dc:creator>teammatt3</dc:creator>
 <guid isPermaLink="false">comment 1253426 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
