Reply to Re: checkbox - again - still not working

Your name:

Reply:


Posted by Norman Peelman on 10/11/73 11:52

"Harold" <harhem@cogeco.ca> wrote in message
news:c9b3d92973578c8702831cf10b2@news.cogeco.ca...
> Hello Norman,
>
> > "Harold" <harhem@cogeco.ca> wrote in message
> > news:c9b3d92972fa8c86ff75207bcde@news.cogeco.ca...
> >> i still can not get the checkboxes to write to the database
> >>
> >> i have a table called skills with the following fields - skillid,
> >>
> > fl_user
> >
> >> This is how i have tyhe checkbox option written
> >>
> >> <td><input type="checkbox" name="skill[]" value="16"> Delphi</td>
> >>
> >> This code always comes up with the error message
> >>
> >> foreach ($_POST['skill'] as $skill) {
> >> mysql_query("INSERT INTO skills (skillid ,fl_user) " .
> >> "VALUES ($skill, userid)");
> >> $result = mysql_query($query) or die('Could not execute INSERT
> >> query');
> >> }
> >> What am i doing wrong??
> >>
> > foreach ($_POST['skill'] as $skill)
> > {
> > $query = "INSERT INTO skills (skillid ,fl_user) VALUES
> > ($skill,
> > userid)";
> > $result = mysql_query($query); // or die('Could not execute
> > INSERT
> > query');
> > if (!$result)
> > {
> > echo '<br>MySQL: '.mysql_errno().' -
> > '.mysql_error().'<br>';
> > echo "$query <br>";
> > }
> > }
> > ----
> >
> > will help...
> >
> > Norm
> >
>
>
> Thanks Norm : however it still did not work for me..
> note i did change the $result line to $result = mysql_query($query) or
> die('Could not execute INSERT query');
>
>

Well, not to sound harsh but it wasn't neccessarily suppossed to 'work',
instead show you where the error was. :)

Norm


--
FREE Avatar hosting at www.easyavatar.com

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация