473,322 Members | 1,232 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

How to sort and filter information by categories from MySql to Web?

ilya Kraft
134 100+
Hello,

On my website I have a form where users can make articles.
They Enter Title, Text and choose a category.
The problem is that I don't know how to make the
"Select category thing".
Here is what I need to do.
I need to have a <select> field with <option>'s, like "Home", "Education", "Cars" etc...
So user selects his category and than clicks "Submit" button, which sends all the information to database.
How do I make it so it sends selected category? SO I can than filter everything by category? Say I only want to display articles from "Home" category.

Thank You
May 7 '11 #1
2 2437
johny10151981
1,059 1GB
Follow the example
taken from www.w3schools.com
Expand|Select|Wrap|Line Numbers
  1. <select>
  2.   <optgroup label="Swedish Cars">
  3.     <option value="volvo">Volvo</option>
  4.     <option value="saab">Saab</option>
  5.   </optgroup>
  6.   <optgroup label="German Cars">
  7.     <option value="mercedes">Mercedes</option>
  8.     <option value="audi">Audi</option>
  9.   </optgroup>
  10. </select>
May 7 '11 #2
ilya Kraft
134 100+
Alright, this sorts the category drop down list. My second question was How would I add it to MySQL database? For example I Have form where users put title, content and choose category, but what field do I need to create in database to store selected category, and what php code will sand it to database?

Thnx )))
May 7 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: James | last post by:
Hi, I have the following code: <PRE> <?php $username = "####t"; $password = "####"; $hostname = "####"; mysql_connect($hostname, $username, $password) or die("Unable to connect to
2
by: hera | last post by:
I am new at php and MySQL and have some (ugly, I'm sure) code to populate form select fields with data from a MySQL database, so a user can use those to sort/filter and view the 3,000 records. No...
2
by: news reader | last post by:
Hi, Does anoone of you know if there is already a simple application doing something like this. I would enhance / tune the missing features, but would like to avoid to start from scratch or...
1
by: mohammedsk | last post by:
Hi, I am trying to save information into MySQL using PHP. The data I am saving is in Arabic language. The database table will show some "???" or other characters. If I insert the text directly...
15
by: scatterbrain | last post by:
I'm trying to create a popup form so that my peers have and easy way to filter information by 4 categories: Presenter, Evaluator, Date, or Topic. All this information is stored in my Data table and I...
1
by: Nasher | last post by:
How do you get a combo box to filter the information a user can select in another combo box. Basically i have a orders form where users select a location from a combo box. i then have a second...
3
by: chemlight | last post by:
I have been doing research, and according to what I have found, the field format TEXT supposedly supports unlimited storage. I have a web application, which I am trying to write a save function for....
7
by: ncsthbell | last post by:
Working on converting some old MS2000 access applications to MS2007. I have many datasheets in the application and I have noticed that on all of them the column headers have a down arrow with...
0
by: amit2781 | last post by:
How can we get the role information in MYSQL? Like we get in ORACLE from USER_ROLE_PRIVS table.
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.