SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Addict
    Join Date
    Feb 2012
    Location
    Kiwi in Bangkok
    Posts
    353
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Data will not remember 1st line option

    Hello, some help appreciated,

    I have created a Data Base

    ADD `vh_16R` VARCHAR( 100 ) NOT NULL ,

    yet it will not remember the "Not Required" option, all other options yes, are remembered.

    <td width="16%" align="right"><font color="red">Monthly Rental : </font>&nbsp;</td>
    <td width="16%" align="center">
    <select name="vh_1R6" class="contentfont" id="vh_1R6" style="height: 20px; width: 170px">
    <option value="" selected>Select</option>
    <option value="Not Required" <? echo ($item_detail['vh_1R6']=='Not Required') ? "selected":""; ?>>Not Required</option>
    <option value="3000" <? echo ($item_details['vh_1R6']=='3000') ? "selected":""; ?>>3000</option>
    <option value="3500" <? echo ($item_details['vh_1R6']=='3500') ? "selected":""; ?>>3500</option>
    <option value="4000" <? echo ($item_details['vh_1R6']=='4000') ? "selected":""; ?>>3500</option>
    </select>
    </td>

    why?

    all information appreciated

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,022
    Mentioned
    53 Post(s)
    Tagged
    2 Thread(s)
    you say your Data Base won't remember an option?

    you posted a block of code consisting of html and php

    could we see the table please?

    please do a SHOW CREATE TABLE
    r937.com | rudy.ca | Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    Just Blow It bronze trophy
    DaveMaxwell's Avatar
    Join Date
    Nov 1999
    Location
    Mechanicsburg, PA
    Posts
    7,204
    Mentioned
    106 Post(s)
    Tagged
    1 Thread(s)
    Looks like $item_detail['vh_1R6'] should be $item_details['vh_1R6']
    Dave Maxwell - Manage Your Site Team Leader
    My favorite YouTube Video! | Star Wars, Dr Suess Style

  4. #4
    SitePoint Addict
    Join Date
    Feb 2012
    Location
    Kiwi in Bangkok
    Posts
    353
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello r937 and DaveMaxwell,

    yes DaveMaxwell very well spotted, I must have had "s" blindness, looked at that code so many times ....lol

    thank you to you both for your quick helpful replies

  5. #5
    SitePoint Addict
    Join Date
    Feb 2012
    Location
    Kiwi in Bangkok
    Posts
    353
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello r937 and DaveMaxwell,

    yes just tested with the "s" added, all working/remembering well,

    thank you


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •