Re: checkboxes into MySQL(trying again)

From: Date: Mon, 15 Jan 2001 22:16:55 +0000
Subject: Re: checkboxes into MySQL(trying again)
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-34701@lists.php.net to get a copy of this message
Hi Jerry, Feel free (as in GPL) to use my libHtmlForm functions. This should solve your problem. http://www.nirvani.net/software/libHtmlForm/ See: html_input_checkbox() specifically. Jeremy Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: jeremy@nirvani.net http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more Get your own Free, Private email at http://www.smackdown.com/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "<body>" -- Quoted from Yahoo! homepage, http://www.yahoo.com On Mon, 15 Jan 2001, Jerry Lake wrote: > Date: Mon, 15 Jan 2001 14:11:18 -0800 > From: Jerry Lake <jerryl@europa.com> > To: "'Php-General@Lists. Php. Net'" <php-general@lists.php.net> > Subject: [PHP] checkboxes into MySQL(trying again) > > sorry about that, > I forgot to erase the old post > info > > here is a chunk of the code I am using > <snip> > //inclusion of pizza toppings from DB > $query = ("SELECT * FROM toppings"); > $result2 = mysql_db_query($DBName, $query) or > die("Error in MySQL query"); > > echo "<table border='1' cellpadding='2' > cellspacing='2'>"; > echo "<tr bgcolor=" . $colors[ $i ++ % count( $colors ) ] . ">"; > > $colors = array( '#e4e4e4', '#ffffff' ); > > $i = 0; > > while($myrow = mysql_fetch_array($result2)) { > $counter++; > if ($counter > "4") { > $counter = "1"; > echo "</tr><tr bgcolor=" . $colors[ $i ++ % count( $colors ) ] . > ">"; > } > $name = $myrow["name"]; > $personal_cost = $myrow["personal_cost"]; > $small_cost = $myrow["small_cost"]; > $medium_cost = $myrow["medium_cost"]; > $large_cost = $myrow["large_cost"]; > $category = $myrow["category"]; > </snip> > > <snip> > echo "<td valign=top align=left>\r\n"; > echo "<input type=checkbox name=".$name." > value=".$cost.">".$name."</td>"; > echo "</td>\r\n"; > } > if ($counter < 3) { > while ($counter < 3) { > echo "<td>&nbsp;</td>"; > $counter++; > } > } > echo "</tr>"; > > echo "</table>"; > // memory flush > mysql_free_result($result2); > //end topping section > </snip> > > Jerry Lake - jerryl@europa.com > Web Designer > Europa Communications - http://www.europa.com > Pacifier Online - http://www.pacifier.com > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.general (#34701) next »