Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 4 of 4
  1. #1
    Member Anant's Avatar
    Join Date
    Feb 2005
    Location
    Indore , India
    Posts
    50
    Member #
    9049
    hello ...

    thanx for ur concern u all people ...
    i have a problem ...i want to create a form in html and using php and mysql and will submit the data from that form to my database...now i have one drop down menu in that form ...how should i take data for that drop down menu...

    for simple text ..i use $Name = trim($_POST['name']); and then insert the value ...but how to do that for drop down menu values ???

    pls help me out
    Anant

  2.  

  3. #2
    Senior Member Stylise's Avatar
    Join Date
    Jul 2005
    Location
    Mount Martha, Australia
    Posts
    229
    Member #
    10679
    A dropdown menu isn't all that hard. Easier than you would have thought.

    HTML Code:
    <select name="name">
    <option value="1"> option 1 </option>
    <option value="2"> option 2 </option>
    </select>
    Then just read it in as:

    PHP Code:
    $name $_POST['name']; 

    The value atrribute may also take a string but I'm not too sure on that.

  4. #3
    Member Anant's Avatar
    Join Date
    Feb 2005
    Location
    Indore , India
    Posts
    50
    Member #
    9049
    Quote Originally Posted by Stylise
    A dropdown menu isn't all that hard. Easier than you would have thought.

    HTML Code:
    <select name="name">
    <option value="1"> option 1 </option>
    <option value="2"> option 2 </option>
    </select>
    Then just read it in as:

    PHP Code:
    $name $_POST['name']; 

    The value atrribute may also take a string but I'm not too sure on that.
    thanx ..it worked ...thanx a lot

  5. #4
    Member Anant's Avatar
    Join Date
    Feb 2005
    Location
    Indore , India
    Posts
    50
    Member #
    9049
    mysql help

    hi...

    i have been working on a project and for that i made a table :
    mysql_query("CREATE TABLE coun_dir(
    id INT NOT NULL AUTO_INCREMENT,
    PRIMARY KEY(id),
    Name VARCHAR(100),
    Roll_no VARCHAR(20),
    Rank VARCHAR(50),
    category VARCHAR(50),
    sub_cat VARCHAR(20),
    course VARCHAR(50))")
    or die(mysql_error());

    table is created ...and with the help of html and php forms ..i am inserting values in it also ...

    now the problem is that in category there are 3 values 1. engg 2.system 3. prog
    and for each of these values i have 2 values in sub_cat 1.fresher 2. exper

    now i have a requirement of only 3 people have category system and sub_cat of prog.
    what i want is that as soon as my database get these three peoples ..it should post a message saying that no other entry can be made to this fields ....

    how can i do this
    pls help
    Anant


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 08:45 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com