473,386 Members | 1,647 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Query Combo

ddtpmyra
333 100+
I have query combo but I notice It only save the first words. For instance,
Commitee Members
Commitee Officials

It only pick the word 'Committee' and not the next word when I get the getPostValue. Why is it?

Expand|Select|Wrap|Line Numbers
  1. echo "<tr><td><b>OS Staff By</b></td>"; 
  2. $res=mysql_query("select OSName  from tblOSstaff"); 
  3. if(mysql_num_rows($res)==0){ 
  4. echo "there is no data in table.."; 
  5. } else { 
  6. echo "
  7. <td width='80%'><select name=\"staff_by\" id=\"staff_by\">"; 
  8.    for($i=0;$i<mysql_num_rows($res);$i++) { 
  9.    $row=mysql_fetch_assoc($res); 
  10.    echo"<option value=$row[OSName]"; 
  11.    if($Var==$row[OSName]) 
  12.    echo "selected"; 
  13.    echo ">$row[OSName]</option>"; 
  14.    } 
  15.    echo 
  16. "</select><br></tr></td>"; 
  17.    } 
Jan 15 '09 #1
2 1237
Atli
5,058 Expert 4TB
That would be because the value of the "value" attribute is not quoted.
A space has special meaning in HTML tags. It separates attributes from each other.

So, in your HTML, which would look something like this:
Expand|Select|Wrap|Line Numbers
  1. <option value=Commitee Members>Commitee Members</option>
The "value=Commitee" part would be consider an attribute and it's value, and the "Members" part considered a completely different attribute.
And because there is no such thing as a "Members" attribute, it would be ignored completely.

You should ALWAYS enclose attribute values in quotes, or risk running into problems like these.
Jan 16 '09 #2
ddtpmyra
333 100+
Your awesome! It works thanks for the information Atli
Jan 16 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: LouD | last post by:
How can i include a combo box in the criteria field in a parameter query
4
by: meganrobertson22 | last post by:
Hi Everyone- I have a question about how to add and then use the "All" selection in a combo box. I am trying to figure out how to: (1) add "All" as a selection to a combo box and then (2)...
3
by: hmiller | last post by:
Hey everyone, I am having a hell of a time trying to set this menu system up. Here's what I'm trying to do. Combo Box One; is populated by names under properties "row source" "Phase 1"...
2
by: MLH | last post by:
I invoked the combo-box wizard today, telling it to use a 4-table union query as a row-source for the combo-box it was assisting me in building. The error I got was without number and stated,...
12
by: Tom | last post by:
Hello, I have a database of employee data in access and I am trying to create a form with combo boxes for criteria (ex. gender, office, position, etc.) that let the user select criteria from...
5
by: deaconj999 | last post by:
Hi, I have nearly finished my database and I would like to add a query that uses a combo box to get the results, not the usual paramater style input. I suppose it would need a form and a query...
1
by: commodityintelligence | last post by:
Greetings, I am merging a series of different tables into one query to export decision-making information. I have some architecture issues I need to ask for help on. I have no programming...
3
by: emily.a.day | last post by:
I have a book database, and I have set up a query to search by subject. As it is now, the searcher has to know the subject and type it into the query. I wonder if there is a way to have a combo...
3
hyperpau
by: hyperpau | last post by:
Hi there guys! I have a Form where there are three comboboxes. This comboboxes are used as references for the parameter of 3 fields in a query. when I hit a command button in my form, it opens...
0
by: Del | last post by:
Hello and thanks for any and all assistance! I have a database that is used by several users on several different machines. The backend database is housed on a file server. Each user has a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.