Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




Selection Box Only Showing 1 Why?


I am using the following select code: PHP Code:




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Selection
I am making a log generator and I have a minor issue with this script PHP Code:

Selection Box Via Selection
Basically I have a selection box which gets it's values from a database once this is selected the selection box's below will get the correct value from the above selection box which again comes from the database.

The first selection box works by refreshing the current page and adding a variable to the file for example instead of useraddnew.php it would be useraddnew.php?maintcat=5 but the number 5 only gets set the second time you choose from the top selection I hope some one can help sorry if I explained it poorly. Code:

Date Selection
I have some records in my table that I need to extract if they are equal or greated than the current date. The date fields are in format YYYY-MM-DD. Could someone please provide some details on how to do this in php, I think I have a rough idea.

Set date variable to current date, select all records from database where database date is >= current date.

Selection Of Ajax Lib ?
I m working on an PHP based site where in UI I need to use ajax
funtionalities ... I just want some opinion from experts that which LIB
is best for usage.

I was wondering that using XMLHTTP is sometimes a bottleneck for cross
browsers application.

Different libraries are here but not sure which one to select.

Database Selection
I created two web database applications - first one is the company
news system (as part of the company pages), second one is the
company data presentation system (part of the company pages, too).
All (unfortunately) the M$ environment - NT or 2003 server.

The first app is managed from the web interface, the second app is
managed by database client win32 app (created by PowerBuilder, std
client-server approach, ODBC). For the second app I need to create
the web presentation interface now (no data modifications, heavy sql
queries :-( ).

The first app contains only small amount of data (10 database
tables, max 100 rows in the largest table) but the second app
contains large number of tables, more than 100000 rows in major part
of tables, very sensitive company data, requires sophisticated and
intelligent db engine strategies for queries, ...

For the first app I wanted to use MySQL, for the second one I wanted
the Sybase SQL Anywhere. But now I am in doubt. I'm playing with the
idea to substitute the Sybase SQL Anywhere by the PostgreSQL or
MySQL. I need all the SQL decorations (stored procedures, stored
functions, triggers, declarative referential integrity (foreign
keys), ...) I'm playing with the idea to unify the database
environment (use only one db engine and two databases, not two
different db engines for two databases), too.

Is the MySQL or (preferably-IMHO) PostgreSQL database engine stable,
robust, safe, ..... in order to use it for these company very
sensitive data, for heavy data mining app, ... ? Is it safe to unify
the database engine types and use only one engine for these two
apps/dbs? Can I rely on the MySQL and/or PostgreSQL engines? Do you
suggest me to use (one of/both) these two db engines for the main
company data presentation database?

Multiple Selection
I have a form that grabs reords from a mySQL database and presents the information in a nice pulldown menu. The client now wants that little menu to be a list that you can select multiple resords from (this is a brochure request for - the list has a max of 12 pieces).

I know how to get the form to look the way I want, but when I parse the form with the little app I wrote in PHP that varifies the data entered, checks feilds, and then enters it in a mySQL database for tracking purposes - there is only one record in the database - even though there were more that one records selected. Now I am simply entering $properties (the variable of the menu feild) in the the INSERT statement of my database query - do I need to parse the records selected first - what am I doing wrong...?

Seperate Selection
I am trying to select data stored in a database as u can see and it gets dispalyed. But my problem is I need to beable to select each item individually instead of all at once or 1 item only. I need to beable to select say bread as an item and milk as an item but at the moment I can only select 1 or all items. PHP Code:

Selection From A List Box.
php and have to implement this functionality to
select a user from a list box. I have written the code for this, but
the problem is after selecting a name and doing the required task, it
again selects the first entry in the list box. So if there are 100
users, the 100th one has to scroll down again and again.

I need to modify this code so that until the session expires, if a
person has selected his name once, that name will be selected in the
listbox until he changes it.

<select name="name" style="width: 120px;">
<?php
$query = sprintf("select * from person order by person_name");
$result = mysql_query($query);
$i = 0;
while($row = mysql_fetch_array($result))
{
$i++;
printf("<option
value="$row[person_num]">$row[person_name]</option>");
}
?>
</select>

Form Selection
I am working on a form right now that when you click a radio button at the top it will select a few of the other radio buttons. Here is the code that i have. I just dont know how to do this. I have never done this type of form before. Code:

Listbox And Its Selection
im trying to create a webpage using mysql and php. im using the below code to populate a listbox with playernames held in my database. once i select a name; im trying to make the page gather the relevant information from that users details to be displayed on the same page.

for example if i select "MoFish" from the listbox, i want it to echo all MoFish's details in the page such as his:

"age"
"height"
"weight"

if i select "Berty" i want it to echo bertys details. how can i acheive this? Code:

Random Selection
i want to randomly select 5 different values from a database, from one table, and then just assign those values to some php variable.

Option Selection
I am making a Option Box (Drop down bar) for Gender, (Male,Female) and I want when they Select there Gener, and then hit submit, it Writes to to a Database.

i have it set it up so far that it goes to another page to INSERT it into the Databse.

Dynamic Variable Selection...
Is it possible to create a bunch of variables in a loop with different #'s at the end of their name... like:

while ($counter <= 10)
{
$myvar$counter;
}

to create 10 variables.... mayvar1, mayvar2, mayvar3, etc.....
is there a way to do that?

Getting Multiple Selection Into One String
I have a listbox with 5 options. I have set it up to be able to choise more than one option. What I need to know is how to get all the selection into the one string that is stored in the DB

It is easy to get the first selected option to post into the DB.

Random Selection Of CSV's
Is there a function in PHP-MySQL to randomly select comma-seperated
variables in a text field?

For example if you have a text field containing the values
"1,1.2,4,5.6," is there a way of randomly selecting one of the numbers?

Multiple Selection Form
I have made a multiple selection form, but when I select more than one option, it still only returns one. PHP Code:

Random Selection Of String Value
Please tell me how I can randomly select a string from a limited set
of string, and then use it in links.

With equal probability, suppose half the time I want
to form a link to domain.com/1234/page.htm and half the time I
want to link to domain.com/5678/page.htm . I would like to be
able to put something into my link such as:
domain.com/<?php ... WHAT GOES HERE? ... ?>/page.htm

If possible, I'd like to use a method that will put either 1234 or
5678 into a variable, so that, once it's randomly chosen for a
document sent to the browser, then numerous references to that
same string value can be used on the page.

Multiple Selection Lists?
i have a mutliple selection list on a form that goes like this

<select name='name' multiple size=6>";
echo "<option value='one'>one";
echo "<option value='two'>two";
echo "<option value='three'>three"; etc it works fine.

BUT how do u call it. For example say i selected option one and three. How do i call that on the next page so that ONE and THREE are stored.

Printing A Document Or Selection
Is it possible to print output generated with php to a local printer attached to a PC or MAC... The server being used is shared hosting.. not a windows server... I was looking at the Printer Function in the php manual but it is not very clear.

Selection Of Records In List
I was wondering how to query MySQL to display only a selection (1-20,
21-40) of a query in an HTML list. Can that be done in an SQL
statement, or do you have to use PHP to dissect the returned array
with for n elements to n+20 elements. How does Google achieve the
returning of results in its search engine. I imagine that the same
query may not necessarily be executed each page listing. I am
wondering whether the results from the query would return an array of
say 36000 elements.

Make Selection In Array
I have this array:

name => john, age => 45, profession => teacher
name => hank, age => 22, profession => student
name => mary, age => 36, profession => dancer
etc.
etc.

It's going to be a big array.

Now what i wonder, how can i do the following;
while( $array['name'] == 22 )
{

do something.

}

I want to prevent the following:
while( $array )
{

if( 'name' == 22 ){

do something

}

}

Because this would create a big loop everytime.

Default Selection From Query
I'm having difficulty trying to have a DEFAULT selected record from a query in my dropdown box (code below). I have about 20 records in a 'facility' table, which listed names of our company's locations. I want to default select one of those records "exton" to be selected in my dropdown box. Code:

Multiple Lists Selection
I am using a simple registration form that i made with the toolbox, but when I come to a multiple list to choose from (populated from the database) it doesn't work correctly. Of course, out of the multiple items selected only the last one gets inserted.

From what I have read, the selection must be turned into an array then looped for this to work. Is this correct? Next how would I code this to work right. If you let me know which code to post, I will post it.

How To Combining 2 Db Fields Into One Selection?
In my db I have 2 fields: first_name and last_name & I want to combine these 2 fields in my drop-down menu.

What I have now is showing only the first_name -- I know that it needs to go into the third option in here, I'm just not sure how to get both of them into it. I can get the first_name OR last_name, but not combined. Code:

Remember Drop Down Box Selection
Is there a better way to do it than i currently am using? Simply echos the value in the selected option that will otherwise be blank, so this makes it impossible for the user to select no input. Code:

Multiple Selection Lists &
I have 2 multiple selection lists. I am using javascript so that users can select items from list 1 and move them to list 2. When the user submits the form I need my php to get the values he has/she has in list 2...

I have done printf($_POST['list_2']) and it only shows one value, even when multiple are selected. I read that I need to change it's name to list_2[] but if I add the brackets to the name my javascript quits working.

Form Selection Target
I would like to design 1 php page where a dropdown list will appear. depending on the user's selection, it will go to the next dropdown list (the list will appear only after the first dropdown is selected) and so on.. .. at the end, a textarea box will appear that will display all the variables that the user have selected. How do I go about in making that happen?

Dynamically Filling Selection Boxes
I was wondering if anyone knows how to fill a selection box with different values depending on a selection made in a nother selection box in the same page. I dont know if what I'm tryin to do can be done or not, at least in PHP. First a quick background:

We have a number of projects running right now, each of which is subdevided into various tasks. Now, I've got two selection boxes. The first contains a list of all current projects. What I want to do is this: when someon selects a project from the first box, I'd like the second box to be filled with a list of the tasks that have been assigned tot hat project.

Building A Category Tree For A Selection Box?
I'm trying to create a selection box in a form which displays all categories in a database, along with indents for sub categories. Code:

Wiki Software Selection Advice ?
We have a short list of wiki software listed below that we are
evaluating. The project will also be using wordpress and there will
need to be some integration between the wiki and wordpress. It seems a
wiki that can use mysql and is also PHP based would be favorable.

I had also considered DBM/DBA which are object persistent databases,
but our team does not seem to favor that solution, though I have not
really analyzed that approach or have enough experience to feel I
understand all possible advantages or disadvantages that it might
have. I have not been able to find a DBM that works with PHP on
windows which some development will be on. It has been mentioned that
DBA is not going to cache the way a database does, although I also
heard somewhere else it would be faster and I suspect using memcache
with DBA would work, but I am not sure if there would be references
inside the objects that would cause a problem with that ?

I had looked into phpwiki, but had many problems with the install on
windows and I didn't see that it have very good wysiwyg editing.

Anyway, the short list:

mediawiki
bitweaver
jspwiki
snipsnap

pmwiki is set up to use flatfiles, so we may be dropping that,
although possibly it could be modified to work with mysql.

Drop Down Menu Selection Activation
I have a form that is populated with a drop down list and a list box. I
want to be able to automatically populate the list box, whenever a user
selects a new item from the drop down list.

Is there a way of doing this as soon as a new item is selected from the
drop down box? (I'm trying to mimic a rich client interface in a web
browser).

Add To Date Based On User Selection
I have a form with Radio buttons that when selected should add "$howMuch" amount of hours to the current date and time and put the output into a field called "ExpireTime". The code I'm using for the hour adding: PHP Code:

User Selection From Drop Down Menu
I have 2 drop down menus. 1 is to pick a Province and the other is to
pick a trade (plumbng electrical etc)

The user selects which province and then what trade then hits submit
which should list all entries in the table. How would I formulate the
select statment for MySQL to display the results in a webpage. The
variable in my form are $province and $category

Drop Down Boxes Change By Selection
what i'm trying to do is when a user selects a country say UK, all the uk states are displayed in another selection box below BUT if the US is selected all the us states are shown, this is on nion every friends/dating site just curious as to how this is done.

Chain Selection For Drop Down Menu
I have a java script that has a drop down menu where a person select a state and then all the cities for that state show up right next to it.

my problem is that the script it is making the webpage runing slow, or sometimes is telling me that the insternet explorer is running slow because of it and i was wondering if there is a better way to do this with PHP and where should i start

Result Of Checkbox Selection Into An SQL Request
I would transfer the result of a checkbox selection into an SQL request.


Default Selection Radio Button
I have a table where users input a date, time, and quantity for a reservation.  On my page ... because I have a junk calendar and coding, every time you click a different month on the calendar or click the "book now" button without entering all the necessary data, the page refreshes and erases all the data. 

One significant problem is that the times display as radio buttons. Some tours have one time and some have multiple times. On the page, if there is only one time, then to make it easier for users to book tours, I inputted CHECKED into the html code. But unfortunately if the tour has multiple times, then CHECKED doesn't work for the first radio button, it defaults the last radio button because of the php loop. Code:

Selections On Dropdown Selection-boxes
I have a article manager script that im nearly done with and when you press save, it takes you to another page to check that you have entered the required fields by checking for the POST vars, if not it redirects back to the page and stuffs the entered fields into GET vars header( location: file.php?errors=$errors&var1=$var1 ) 's you back to the previous page.

Now i have no trouble reshowing the entered info in regular text fields as i grab it from GET but i dont seem to be able to reshow a drop down box selection it always reverts back to the first option when i redirect the page.

Filtering Selection In Multiple Drop Down Boxes
I want to allow a user to conduct a search on a database using multiple drop down boxes.
On the first page they will have a drop box filled with records from field A. Once they select which one they want, a second drop down box will then appear with records from field B which are present for field A (a filter).

What I want though is that the first dwon down box still appears on the second page, but shows the record that the user selected. What is happening now is that when the second page comes up, the first box shows the default selection rather than the selection that the user chose. My code for the drop down boxes is: PHP Code:

Identifying User's Pick From Selection List
I have an application that uses PHP to access a MySQL table and
extract rows which match the user's search entry. Data from the
matching rows are loaded into an HTML selection list, and the user can
scan the list and highlight a selected item.

My question: In PHP, what is the syntax for identifying which row is
highlighted?

My goal is to pass the unique row ID of the selected item to a
subsequent form where all the fields will be displayed for the user to
edit.

I already have the code that loads the selection list and the code
that displays the fields. I just need to know how to determine the
highlighted item.

I have two PHP books, and both discuss loading the selection list, but
there is no mention of what to do next.

Autopopulating Drop Down Not Saving Unless A Selection Is Made
I have a form that autopopulates and allows user to make changes where necessary. In this form are some drop down menus (hardcoded on the page). All the selections (50 states for example) are there. If I select a state it will then post to the database. If I don't select a state and just leave it as the previously selected state (not change the selection already made by a user) it puts a blank in the database.

Examples:
The <?="$rest_state_pr"?> will pull the state the user selected previously. If I change the slelection it saves the new selection, but if I leave it as the "default" It puts a blank in the database. Code:

Random Word Generation From A Selection Of Words
does anyone have a piece of code, which randomly generates a word? For example, when you click on a link called say...   Random Name, it will come up with a name, either Paul, Luke, John or Terry (but only one of them, so eventually I can have loads so it goes on and on...) Get what i mean?

If you're wondering why I need this, it because I'm making a website where you can choose a type of pet and then click on  'Gimme A Hamster Name' and it will come up with a hamster's name.

Calling A Php Function From A Form Selection List
I have a function that will read records from the database and populate an area of my webpage based on a value selected from a list box. 

I have got it to work fine if the user hits a submit button but I was wondering if it possible to perform the function dynamically each time the user changes the value in the list box.

Img Not Showing Up?
I am using the following code to pull an img url from my database but the img is not showing up just a place tag why? PHP Code:

Showing A URL
I am very new to using mysql and learning php. I need a little direction on where to look for my answer to a question.

Is it possible to store a URL in a mysql table and then have it display on a webpage in a table that then it can be clicked on and taken to the URL?

I have learned how to make the information show in a table as text, but not as a hyperlink. I can get it to show as a link to the root directory of my website.

$_POST And Selection, Checkboxes, Radio Buttons On Forms
I'm creating a web form that has a number of radio boxes and drop down selection boxes and I can't get the $_POST global variable to hold the value if the person makes a mistake and has to go back and make corrections! It will work for normal text boxes and text areas but not the above! below is a snipit of my code PHP Code:

Saving Selection In Drop-down Lists In PHP After Page Reload?
I can't find an answer to my quesiton anywhere.

Given a drop-down list with USA states and other text fields I pass
this information for further processing via PHP. If any of the required

fields is empty, the PHP script would return an error and reload the
form page asking to fill out those fields. All entered information is
saved... except for the drop-down list selection. I tried to write a
Javascript function which is echoed by PHP, but interpolation of PHP
variables in the Javascript section gives a syntax error message in
Javascript.

The PHP script returns, e.g., an "AL" string for Alabama. Of course, I
don't want to write PHP code for each option to make it selected.

Multiple Array Selection From Database Instead Of In-Page Arrays
Have posted before, but will simplify problem here. For original post go to
http://forums.devshed.com/t80025/s.html

I have setup 2 arrays like so in my one page script:

Code: ( php )

Populate A Drop Down List In A Form On The Basis Of A First Selection
I have developed a form to register a property in a db. The form needs the selection of a country and then based on that selection the selection of regions from the selected country. I have a program which allows selection of a country and then a region but it uses java script which I would like to avoid. I also just wanted one submit button if possible. Code:


Copyright © 2005-08 www.BigResource.com, All rights reserved