davinci Posted March 12, 2006 Share Posted March 12, 2006 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? Quote Link to comment Share on other sites More sharing options...
AndyB Posted March 12, 2006 Share Posted March 12, 2006 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] Quote Link to comment Share on other sites More sharing options...
davinci Posted March 12, 2006 Author Share Posted March 12, 2006 Ok, I'm an idiot.:PI forgot the " ' " marks around '$category' in my query. So sorry to waste your time! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.