RE: Re: checkbox into mysql using php <input type="checkbox" name="list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thank you,

i don't have any problem using that syntax:
if (isset($_POST['submit'])) {
echo "You chose the following games:<br />";
foreach($_POST['games'] AS $game => $value)
$sql = mysql_query("insert into interest(username) values('$value')");


but the problem is with the following:


$valuecount = count($value) for($i =0; $i < $valuecount; $i++) { $sql = mysql_query("insert into interest values('$value', '$value[$i]')");

I don't get any input into mysql.

kind regards
m


&gt;From: pete M &lt;pmorgan@xxxxxxxx&gt;
&gt;To: php-db@xxxxxxxxxxxxx
&gt;Subject: Re: checkbox into mysql using php &lt;input type=&quot;checkbox&quot; name=&quot;list[]&quot;value=&quot;x&quot;&gt;
&gt;Date: Wed, 16 Feb 2005 18:22:14 +0000
&gt;
&gt;foreach($_POST['name'] as $k =&gt; $v){
&gt;
&gt;}
&gt;
&gt;moses Woldeselassie wrote:
&gt;&gt;hi all
&gt;&gt;
&gt;&gt;
&gt;&gt;I need a simple php script to use for html
&gt;&gt;
&gt;&gt;
&gt;&gt;
&gt;&gt;&lt;form action=&quot;checkbox.php&quot; method=&quot;post&quot;&gt;
&gt;&gt; Select from the list &lt;br /&gt; (check all that apply):&lt;br /&gt;
&gt;&gt; &lt;input type=&quot;checkbox&quot; name=&quot;list[]&quot; value=&quot;x&quot;&gt;
&gt;&gt; &lt;input type=&quot;checkbox&quot; name=&quot;list[]&quot; value=&quot;y&quot;&gt;
&gt;&gt;&lt;input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;Go!&quot; /&gt;
&gt;&gt;&lt;/form&gt;
&gt;&gt;
&gt;&gt;kind regards
&gt;&gt;meberat
&gt;
&gt;--
&gt;PHP Database Mailing List (http://www.php.net/)
&gt;To unsubscribe, visit: http://www.php.net/unsub.php
&gt;


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux