Select From Drop List To Fill Table Column With Text -- HOW ?
I want viewers to compare state laws on a single subject.
Imagine a three-column table with a drop-down box on the top. A viewer
selects a state from the list, and that state's text fills the column below.
The viewer can select states from the drop down lists above the other two
columns as well. If the viewer selects only one, only one column fills. If
the viewer selects two states, two columns fill. Etc.
I could, if appropriate, have a separate htm page with the text for each
state -- california.htm for example. When the viewer selects California from
the drop down list, the column below would "fill" with California.htm.
Or, I could conceivably use a text or mysql database with two fields for
each record: state_name and law_text -- but it would probably be easier to
use separate htm files, since there will only be about 20 states involved,
and the "database" would never have a large number of records.
The table width would be 100% and each cell would be @33%
My site is designed with FP 2002 and runs on Apache/FreeBSD. I have just had
Apache-ASP installed but I have not yet configured or used the module.
View Complete Forum Thread with Replies
Related Forum Messages:
Dates Fill Drop Down List
I have a drop down list and would like to fill it with 12 months starting from whatever the current month is: EG: Current month is July 2005 I would like the list to show: July 2005 August 2005 . . . July 2006
View Replies !
Trying To Select Names From A Drop Down List And Display Them
So, I already have the code written where I have a drop down menu with names in it. I want to be able to select multiple names from the drop down list and have them display in a table below the drop down menu. First off, I can't get one name to display, not to mention multiples. :p How may I accomplish this? CODE:
View Replies !
How To Response Immediately When I Select The Drop-box List
Do you have any idea when I try to select a drop box list, the data will show up in the following textbox immediately? eg. Name: --------------- drop-box list | <- when i select one of them --------------- Age: --------------- Textfield 1 | <- pop up immediately --------------- Address: --------------- Textfield 2 | ---------------
View Replies !
SELECT * FROM Table WHERE Column IS NOT NULL
I am running the following MySQL query: <?php $sql = mysql_query("SELECT * FROM comics WHERE story_arc IS NOT NULL") or die (mysql_error()); while($row = mysql_fetch_assoc($sql)) { echo $row['title']; } ?> The problem is that it is outputting all 4000+ records, when it should only be about 100. Is there an error with my 'IS NOT NULL'?
View Replies !
How Do You Insert A Value From Drop Down List To SQL Table?
I am a bit new to PHP and SQL so this may seem like a dumb question. I have already created a drop down list as part of a form which is automatically populated with values taken from a separate database. When a user goes onto this page and either leaves the default value or selects a value from the drop down list and presses the submit button, I would like that selected value to be stored into a database which I have already created in SQL. Just to let you know that I can do the above using a text field but just don't know how to do it with drop down list. If your going to explain any coding then it may help if I give you the names of certain items that are involved. Database is called "Company" Field within database is called "Name"
View Replies !
Select Table From Drop Down Menu
I'm trying to select a table to submit form data to from a pull down menu. How do I submit the table along with the input data? I know I need to modify this line ($sql = " INSERT INTO $dnc "; )somehow to use the table selected in the pulldown menu. Code:
View Replies !
Populate A Drop Down Box With A List Of Managers In A Table Called Employees.
I am trying to populate a drop down box with a list of managers in a table called Employees. Table structure is like this: ID, Employee_name, extension, manager now the manager could have 10-15 employees, but I pulled a query that would just select the distinct managers. I am trying to populate the drop down list with the managers from the table this is what I have: Code:
View Replies !
Auto Fill Dropdown List Error
Im using the code below to autofill a dropdown list from my MYSQL DB. The only problem is it is leaving out the first entry (alphabetically) for each $vehicle_make ? Does anyone know why this may be hapenning? Code:
View Replies !
Auto Fill Date Dropdown List
How would I modify this code to display the years in the dropdown list like so: current year 2006 2005 back 50 years <select name="year" id="year"> <?PHP for($i=date("Y"); $i<=date("Y")+2; $i++) if($year == $i) echo "<option value='$i' selected>$i</option>"; else echo "<option value='$i'>$i</option>"; ?> </select>
View Replies !
Mysql Ajax Dynamic List To Fill More Than 1 Textbox With A Dif.value For Each?
Ok, I have a database: ie... Id | cab | price | w1 1 | wall | $300 | $19 on my form I have three textboxes: input1 is cab with autocomplete, input2 is price, & input3 is w1 The way I have it now works great, I type a few letters in input1, it pulls up a list, once cab is selected it populates input1 with cab and input2 with price. I want to know once cab is selected, if it can populate input2 with price & input3 with w1 as well? Code:
View Replies !
Fill A Table With Data My From MYSQL DB
I am trying to fill a table with data my from MYSQL DB. I have created a basic affiliate program script and am trying to do the code to display the affiliate stats for each month (traffic) I am hoping to get The html table to look like this: Jan Feb Mar April May .... 55 66 5 45 67 My DB table looks like this: Code:
View Replies !
Print Table Cells To Fill In The End Of A Calendar
I have a variable called $rowCount that keeps track of how many total cells have been added to a table. Its actually the month view of a calendar. I need to print blank cells representing the days of the next month to fill in the cells and make the grid complete. I am almost there, I just need to figure out how to make it stop printing new cells when the $rowCount variable becomes divisible by 7. That would mean that all table rows have 7 columns, and the grid is complete. here is what I tried so far, but this just keeps printing the cells, never stopping. PHP Code:
View Replies !
Filling Drop Down Boxes From MySQL Column
I am having problems filling a drop down box with data from a column in a MySQL table. If anyone is able to see a problem with my coding could they please post where the problems are, and possibly how i would go about fixing it. Code:
View Replies !
Drop Down Box To Filter Data By A Certain Column/'category'
Member primary key is member_no, race is race_no and results is a composite of race_no and member_no. Basically I want a page where users can view race results - i.e. show the members first name and last name (from member table), the race name, race date, race length (from race table), and the result (which is a time, from results table). I want to display all this as column headings and output the relevant data just in a table. Code:
View Replies !
Drop Down A Table Is Suppose To Show Up To Give You The Geocache Table
Under the drop down a table is suppose to show up to give you the geocache table when I had the drop down setup as html it worked fine which leads me to believe something is conflicting in my code. I need an extra pair of eyes to look at it, cause I just cant catch what Im missing. PHP Code: <?php //include files to configure db and open it include 'config.php' include 'opendb.php' //pull name for drop down $query  = "SELECT name FROM geocache"; $result = mysql_query($query); $options = ""; // find the selected geo name $result2 = mysql_query("SELECT * FROM geocache WHERE name = '" . $_POST['name'] . "'"); ?> ........
View Replies !
Get List Of Messages From One Table, Message List Indicator From
I have two tables. One has a list of messages left by users using fields named mbxno for the mailbox and msgno for the message number. I have another table that has mailbox settings for each user that contains a field named "messagelist" to indicate if they want to be included on the message list or not. What I'm trying to create is a list of the most-recent messages with a lookup on the users table to indicate whether a message in the list should be included in the message list based on the user's mailbox settings. SELECT messages.msgno, messages.mbxno, users.messagelist FROM messages, users WHERE (users.messagelist = Ƈ') ORDER BY msgno DESC LIMIT 100 What I'm getting, though is a list that looks like this: mbxno: 1114 msgno: 0412141623 msglist: 1 mbxno: 1114 msgno: 0412141623 msglist: 1 mbxno: 1114 msgno: 0412141623 msglist: 1 mbxno: 1114 msgno: 0412141623 msglist: 1 mbxno: 1114 msgno: 0412141623 msglist: 1 mbxno: 1114 msgno: 0412141623 msglist: 1 mbxno: 1114 msgno: 0412141623 msglist: 1 mbxno: 1114 msgno: 0412141623 msglist: 1 I think what's happening is that I'm using the wrong type of join and more rows are being created than necessary. If I add "DISTINCT" to the query, I get a list of the most-recent messages as I expect, but the "messsagelist" value is sometimes wrong (again, probably because the data is getting jumbled). For example, the messagelist value for the second row (2214) should be 0, not 1. mbxno: 1114 msgno: 0412141623 msglist: 1 mbxno: 2214 msgno: 0412141622 msglist: 1 mbxno: 2189 msgno: 0412141408 msglist: 1 mbxno: 0000 msgno: 0412141213 msglist: 1 mbxno: 0003 msgno: 0412141213 msglist: 1 mbxno: 2265 msgno: 0412132029 msglist: 1 mbxno: 0000 msgno: 0412131950 msglist: 1 How should I be doing this? If nothing else, what kind of join will work with a long list compared to a value from a short list?
View Replies !
Multiple Entries In On Column/List Box
I'm creating a page where members can edit their research information. I'm going to have 12 List Boxes, each with about 20-25 words. I want the user to be able to choose as many as they need (by control+click) - and store them all in the database. I expect each member to only have about 4-5 .. but you never know. The information they submit, all 4 or 5 or however many keywords, will need to be easily searchable on the main page. I also am going to need to make it easy for them to edit/update their keywords. My question is - which is the best way to do this? Do I dumb all the selected values into one column of a table? then when doing a search just do a text search? And how do I implement the update page? I know how to show previous text in a text form field, but is there a way the options they chose can be pre-selected when they go to update their research?
View Replies !
Select Max Column
I have a categories column and a title column in one table. What I'm trying to do is select the most frequently listed title for each category. I would think that this sql statement would do, but it just returns every column. select count(title) from table where title IN (select title from table where category = 'category'); To me the inner select should select every title that has a category = 'category'. Then the outside select should display a count of each title that has that one category listed in the inner select.
View Replies !
Unknown Column 'icaodesc' In 'field List'
I'm getting the following error message... Unknown column 'icaodesc' in 'field list' when I try to update a table from a PHP form. What 'field list' is it referring to? My PHP script or the MySQL table??? Here is the PHP script I'm using... <?php //set up table and database names $db_name ="xxx"; $table_name ="yyy"; //connect to server and select database $connection = @mysql_connect("localhost","user_name","password") or die(mysql_error()); $db = @mysql_select_db($db_name,$connection)or die(mysql_error()); //build and issue query $sql ="UPDATE $table_name SET icaodesc ='$_POST[task_icaodesc]', icaosource ='$_POST[task_icaosource]', icaonote ='$_POST[task_exp_outcome]', usposition ='$_POST[task_usposition]', expoutcome ='$_POST[task_exp_outcome]', usposition ='$_POST[task_usposition]', usaction ='$_POST[task_usaction]' WHERE task_id ='$_POST[id]'"; $result = @mysql_query($sql,$connection) or die(mysql_error()); ?> icaodesc was the NAME in the updatable form. task_icaodesc is a "good" field in the table yyy
View Replies !
SQL/DB Error -- [Unknown Column 'M' In 'field List']
I have a simple form element that drives me nuts. Here's the code: PHP Code: <input type='radio' name='gender' value='M'"; if ($usr->act_gender == 'M') { echo " checked"; } echo "> Male <input type='radio' name='gender' value='F'"; if ($usr->act_gender == 'F') { echo " checked"; } echo "> Female When the form submitted it should PHP Code: ("UPDATE act_details SET ... gender=".$_POST['gender'].", ... WHERE ID = '".$user."' LIMIT 1") But I keep getting the following error: Quote: SQL/DB Error -- [Unknown column 'M' in 'field list'] Even Thought I have such a field in my db table.
View Replies !
Select Variable Column
Trying to select a column that is variable $leg1=week.$week._leg1; $rowh = mysql_fetch_object($query5); print "$rowh->$leg1"; Basically trying to print out a column where the column name (week1_leg1) will increment through a loop.
View Replies !
Select A Column Data
i want select the data in the first column of a row while i clicking a button in the same row. Table has many rows. if i click button in the third row i need to select the data in the first column of the third row Likewise i need to select the data on clicking the button. How can i do this. Now i tried a code. but it ill select the data in the first column of the last row. Code:
View Replies !
Php And Drop Down List
I am coding an email form on a site. A user enters their name and contact email and then selects from a drop down list to which particular email the message should be sent: User1, User2, User3. Then the user types out a message and hits submit. My problem is that I am unsure as to how to grab the selection in the drop down list and pull the selection and place it like this: "$selection@domain.com". Here is the php code:
View Replies !
Drop Down Box To A List Box
i have this drop down box that displays the relevant info from the table that its loading. But the drop down box isn't quite so wise to use if there hundreds of rows. So what i wanted to do was change it to a list box instead ... would any one know how to do that? Code:
View Replies !
Drop-down List
I populate a drop-down list like this: echo "<select>"; foreach ( $ip_list as $var ) { echo "<option>"; echo $var; echo "</option>"; } echo "</select>"; Is it possible to have the selection in the drop-down list default to a particular value? For example, let's say the complete list of values looks like this: 65.162.31.155 210.213.149.6 68.190.20.83 130.202.234.254 68.122.35.157 When the page is loaded, I want 68.190.20.83 to appear as the selected value in the drop-down list. Can this be done? Any suggestions or examples welcome.
View Replies !
A Drop Down List
im just starting out with PHP and im making a website that hosts some images. Its going great so far but I want to have a drop down that can show my albums. such as: Â Â Â Â Â <form name="form" id="form"> Â Â Â Â Â Â <select name="jumpMenu" class="dropdown" id="jumpMenu" onchange="MM_jumpMenu('parent',this,0)"> Â Â Â Â Â Â Â <option value="#" selected="selected">Browse</option> Â Â Â Â Â Â Â <option value="#">Ground - Concrete</option> Â Â Â Â Â Â Â <option value="#">Grass</option> Â Â Â Â Â Â Â <option value="#">Metal</option> Â Â Â Â Â Â Â <option value="#">Graffiti</option> Â Â Â Â Â Â </select> Â Â Â Â Â </form> I want the entrys for this to come from my images folder. For example if i have images/holiday then holiday will come up in the list. Is there anywhere I can get an example of this?
View Replies !
Drop Down List
PHP Code: <? Â Â Â Â Â Â Â Â Â $query = "SELECT `teacher_id`, `teacher_name` FROM teachers ORDER BY `teacher_name`"; Â Â Â Â Â Â Â Â Â if ($r = mysql_query ($query)) { // Run the query. Â Â Â Â // Retrieve and print every record. Â Â Â Â Â Â Â Â Â Â Â Â Â Â while ($row = mysql_fetch_array ($r)) { Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â echo "<select name="teacher">"; Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â echo "<option value="{$row['teacher_id']}">'".{$row['teacher_name']}."'</option>"; Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â echo "</select>"; Â Â Â Â Â Â Â Â Â Â Â Â Â Â } Â Â Â Â Â Â Â Â Â Â }.....
View Replies !
$row In A Drop Down List
I have a query. where I loop through courses, I get the id for each course, pass it to the next page then, I want to query the database again with it, how do I do this. <select name="course"> <?PHP $query = "SELECT * FROM courses ORDER BY course_name"; $result = mysql_query($query); while ($row = mysql_fetch_assoc($result)) {  echo "<option id='".$row['id']."' >";  echo $row['course_name'];  echo ' ['.$row['course_date'].'] ' ; echo ' £'; echo $row['course_price']; // echo the number  echo '</option>';  } ?>  </select> Get the ID then pass it. how do I use it again on another page and another query.
View Replies !
Invalid Query: Unknown Column In 'field List'
I'm getting this error when I execute my form and it brings up the corresponding .php page. Invalid query: Unknown column 'DCS' in 'field list' Whole query: SELECT DCS#, CLIREF, GUAR, PAT, ADDR1, ADDR2, CITY, ST, ZIP, SS#, DOB, PHONE, DBAL, TBAL, PAID FROM crossroads10 WHERE CLIREF='ZQ02037/8558' Here is my code:
View Replies !
Error: Unknown Column 'OOM210' In 'field List'
Can someone tellme why I get the following error? Error: Unknown column 'OOM210' in 'field list' $flightnumber is equal to OOM210... (INSERT INTO and VALUES are on the same line, but here it is split so it is easier to compare.) $sql = "INSERT INTO flights (flight_num, dept, dest, depticao, desticao, depttime, desttime, stops, duration, freq) VALUES ($flightnumber,$departure,$destination,$departurecity,$destinationcity,$departuretime,$arrivaltime,$stop,$duration,$freq)"; Â if (!mysql_query($sql,$con)) Â { Â die('Error: ' . mysql_error()); Â }
View Replies !
SELECT From 2 Differerent Tables, Only From 1 If A Column = -1
I have a Web page which must read data contained in a table called "operateurs" (operators in English). It has the following columns: id, Surnom (nickname), id_Usager (user id) If an operator has a user id, id_Usager contains it, but if he/she doesn't have one, it is set to -1. At the moment, when I extract data from the table, if id_Usager is different from -1, I read the operator's nickname from the usagers (users) table. Code:
View Replies !
A Dynamic Drop Down List
I need to create a dynamic drop down list. By this i mean that the webpage html form = select style will recieve all the values as based on a query to a mysql database. I have no problems quering the data base with PHP, But i need to make some kind of for loop that will add a new value to the selct form for each result from the database. my thought process go like this. 1. call data base to guery. (no problem) 2. make variable variables that will be created according to the number of results (these variables must be created according to results of query, not a problem i think) 3. make a form like this <form action = ***** method = post> <select name = ******> <option value = "This is a query result"> This is a query result> //This is the part i need to using a for loop and variable variables </select></form> so my problem is part 3, cause is this all done in PHP, or if i had all these variables, can i do this in HTML? Can i make a for loop in PHP that would break into HTML during these parts?
View Replies !
2 Drop Down List Using MYSQL
I have a model table with the following fields: MODEL_ID, MAKE_ID, NAME. And a make table with the following fields: MAKE_ID, NAME. The first drop down list (make) to select a make of a car i.e. Chevrolet, Ford. When a make is selected, then all the model for that paticular make appear in the second drop down list.
View Replies !
PHP And MYSQL Drop Down List
I need a script to create a drop down list which has vehicle makes. The vehicle make list should feed a vehicle model list so when I select a make all the models for the make appear in the model list. I have a make table which has MAKE_ID, make NAME and a model table which has MODEL_ID, MAKE_ID and model NAME. I tried using a script using javascript array but wherever I have a query that pulls the NAME from the database there's always a carriage return after the NAME which messes up the javascript array. I'd rather do it all with PHP if possible. If not please give me one that works and I don't have to spend hours troubleshooting.
View Replies !
Very Simple Drop-down List...
Hi! I'm having a problem with a very simple drop-down list since the page comes out with no elements in the drop-down but giving no errors. This is the code: <form name="year_search_form" method="post" action="results.php"> <select name="select_year" id="select_year"> <? $query="SELECT * FROM table ORDER BY year"; $result = mysql_query($query) or die ("Error in query: $query. " ..mysql_error()); while ($line = mysql_fetch_array($result)) { print ("<OPTION value=".$line['year']."></OPTION>"); } ?> </select> </form>
View Replies !
Drop Down List From An Array
I want the array to contain a valid year of birth for anyone between the ages of 16 and 80. I'm pretty sure this code is correct.(though it might be a bit sloppy to all you pros) Code:
View Replies !
Drop Down List With Months
I am trying to create a drop down list that has December 2006 as the first option and then goes up month and years till the current month and year (September 2007).
View Replies !
Putting List Into Drop Down
I am working on a directory of businesses which has 8 main categories and each category has several sub-categories. Example: Dining is a Category with Pizza, Fast Food, Chinese, etc. I have the sub-categories brought up in just a list on the left side of the page and when the user clicks on a sub-category it takes them from client_list.php to client_filter.php only showing businesses in that sub-category of the main category. So only pizza places listed under dining. However, I want to change the list to a (form) select box and then have the user click on the sub-category they want and then it takes them to the client_filter.php page to list only those bussinesses in that sub-categorie. So after that long explanation how do I change my code to do that. Here is my current code:
View Replies !
Insert From An Drop-down List
i have a table in wich i've inserted city's name.then i have an registration form in wich i want to display an dropdown list with the cities from the table, and if one city is selected to be automaticly added in the second table. how can i do that?
View Replies !
Custom Drop Down List
I am trying to get categories from the database and show them in a drop down list showing root category then their sub category underneath. Code:
View Replies !
Folder List Drop-Down
I am developing a PHP/MySQL project and as part of my initial setup and configuration scripts, the users can select a skin for the application, and a variable value ($skin) is updated to set the current skin, this works ok on it's own, but currently the user must manually type the skin name in a free-text box. Ideally this needs to be a drop-down option box, and I would like this to be populated by listing the sub-folders within the '/skins' folder, so that it's always up to date. The folder structure looks like this: /skins /skins/skin1 /skins/skin2 /skins/skin3 How can I use PHP to generate a list of the current sub-directories in 'skins' and populate the drop-down list?
View Replies !
|