Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.