PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old October 21st, 2003, 06:41 PM
Bruski Bruski is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Toronto, Canada
Posts: 192 Bruski User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
php drop down menu

i made this simple thing to get a query from the database and display it in a drop down menu... i cant seem to be able to get the proper id for what i have selected...any suggestions...

PHP Code:
echo "<select name=\"hello>";
            echo 
"<option value=\"\"></option>";
            
$query "SELECT * FROM headings";
                
$result mysql_query ($query);
                while (
$row=mysql_fetch_array($result)) {
                    
$head=$row["id"];
                    
$title=$row["title"];
                    
$description=$row["description"];            
                    echo 
"<option value=\"$head\">$head</option>";
                }
            echo 
"</select>";
        echo 
"<div id=\"addForum\">";
        echo 
"<form name=\"post\" action=\"index.php?page=./forums/index&head=$head&action=forumAdd\" method=\"POST\"><br>";
        echo 
"Forum Name:<br><input type=\"text\" value=\"\" name=\"forumName\"><br><br>";
        echo 
"Description:<br><textarea id=\"replyTextArea\" name=\"description\" rows=\"2\" cols=\"50\" wrap=\"virtual\"></textarea><br>";
        echo 
"<input type=\"submit\" name=\"submit\" class=\"submit\" value=\"REPLY\">";
        echo 
"</form>";
        echo 
"</div>"

Reply With Quote
  #2  
Old October 22nd, 2003, 11:55 PM
bubblocity bubblocity is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 2 bubblocity User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
What is your table structure ?

And whey is your <select> box outside the <form></form> tags?

Reply With Quote
  #3  
Old October 23rd, 2003, 07:56 AM
Bruski Bruski is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Toronto, Canada
Posts: 192 Bruski User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
yeah sorry i solved the problem...i was a little slow yesterday

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > php drop down menu


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


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





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