Database Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesDatabase Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
Dell PowerEdge Servers
  #1  
Old March 13th, 2008, 02:39 AM
akaki akaki is offline
Registered User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Dec 2007
Posts: 15 akaki User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 19 m 43 sec
Reputation Power: 0
MySQL 4.1 - Putting always fixed text in dropdown list box

Hi Everyone,
In the dropdown list box with auto increment properties, I inserting text & they are saving in the database. And at last I insert this "N/A" value.
Bit if I insert another value later, then they are appear after "N/A". But I want to display always "N/A" at last in the front.
So, How is it possibe? I m retriving the values from table & displaying in the list box.
Plzzzz help...

Reply With Quote
  #2  
Old March 14th, 2008, 07:56 AM
lig's Avatar
lig lig is offline
"Forum Nazi"
Codewalkers Demi-God (4500 - 4999 posts)
 
Join Date: Apr 2007
Location: Jacksonville, Fl
Posts: 4,719 lig User rank is Private First Class (20 - 50 Reputation Level)lig User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 Days 4 m 29 sec
Reputation Power: 6
Quote:
In the dropdown list box with auto increment properties


*blink* *blink*

how can html have auto-increment? clarify what you are doing and asking please
__________________
life is a game.... Have fun
-----------------------------
http://www.phpwomen.org
strength in unity

PHPCommunity IRC
#phpc on freenode

Reply With Quote
  #3  
Old March 17th, 2008, 06:10 AM
akaki akaki is offline
Registered User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Dec 2007
Posts: 15 akaki User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 19 m 43 sec
Reputation Power: 0
display in the last position

Quote:
Originally Posted by lig
*blink* *blink*

how can html have auto-increment? clarify what you are doing and asking please


Actually, I m not typing manually in the <select></select>in the php page.
I m retriving values from database. here N/A is the last. But if something inserted after N/A, then it will be displayed after N/A in the list. But I want to display always last position N/A in the list box, clear...
So, is there any query???

Reply With Quote
  #4  
Old March 17th, 2008, 06:26 AM
lig's Avatar
lig lig is offline
"Forum Nazi"
Codewalkers Demi-God (4500 - 4999 posts)
 
Join Date: Apr 2007
Location: Jacksonville, Fl
Posts: 4,719 lig User rank is Private First Class (20 - 50 Reputation Level)lig User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 Days 4 m 29 sec
Reputation Power: 6
Why not leave the N/A Option out of the DB and just have the script put it in after it loads all the options from the DB? Another alternate option is to have N/A selected no matter where it is in the ordering returned from the db

Code:
if($option ==="N/A") { echo 'selected="selected"';}


anyway - if you absolutely must have the N/A as the last value - you will have to some fanagling. first thing that comes to mind is to make a look up table where the primary for N/A is either the smallest (1) or the largest in the listing so you can do a simple ORDER BY in your query. It will require a JOIN however if you want to know what the value for anything else though. You can't even order it based on the alphabet since N is right in the middle - which is why the look up table.

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesDatabase Help > MySQL 4.1 - Putting always fixed text in dropdown list box


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five &quot;checkpoints&quot; for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway