Jump to content

Form Problem


davinci

Recommended Posts

I have form to upload news. Works well but I'm trying to add a drop down box to select the category. I've created a column called category in my news table. For the form I am using this code:

[code] <tr><td>
<select name="category" style="border: 1px solid #000000">
<option name="Type" option value="Type">Type..</option>
<option name="Ad" option value="Ad">Ad</option>
<option name="Video" option value="Video">Video</option>
<option name="Gallery" option value="Gallery">Gallery</option>
<option name="News" option value="News">News</option>
<option name="Other" option value="Other">Other</option>
</select></td>
</tr><br>[/code]

But whenever I try to use it I get the error:

Error, query failed : Unknown column 'Video' in 'field list' (or instead of video, whichever value I selected).

What am I doing wrong here?
Link to comment
https://forums.phpfreaks.com/topic/4767-form-problem/
Share on other sites

The field name is in the SELECT line. Your OPTION lines should not have a name at all.

[code]<select name="category" style="border: 1px solid #000000">
<option value="Type">Type..</option>
<option value="Ad">Ad</option>
<option value="Video">Video</option>
<option value="Gallery">Gallery</option>
<option value="News">News</option>
<option value="Other">Other</option>
</select>[/code]
Link to comment
https://forums.phpfreaks.com/topic/4767-form-problem/#findComment-16733
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.