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


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Easy Comma-delimited List To Dropdown Box Converter


I was working on a simple converter when I realized that by not setting the id param of the option tag, it wasn't going to send the value of the dropdown box to my php script. I had this to start with: Code:




View Complete Forum Thread with Replies

Related Forum Messages:
Regular Expression :: Find Word Matches To Words In A Comma-delimited List
What's the *right* way to find word matches to words in a comma-delimited list. For example, if I have the following comma-delimited list of categories in a mysql db field:

gameboy, nintendo, playstation

and I do a search, I know I can use regexp to do something like:

select * from categories where regexp 'gameboy,'

Notice that I have the comma in there to match the whole word and the comma without matching part of a word (to prevent unwanted matches such as "play" to "playstation" or "game" to "gameboy"). The problem I'm running into is words that match that match the end of each word next to the comma (in this example, "boy" and "station"). What's the right way to match a word *exactly* using regexp *without* also matching *part* of a word.

View Replies !
Comma Delimited File
I am trying to read comma delimited rows of text. The problem is that
some fields may be encapsulated in "" - particularly the text fields but
not numeric fields.

Is there a simple efficient way to parse the fields with comma but also
strip off the "" encapsulating some of the fields with php?

The problem is the "" encapsulation is optional. Some fields will have
it, some won't.

View Replies !
Statement With Comma Delimited Fields
I'm hacking into my vBulletin forum to use individuals current usernames, passwords, and membergroups to setup a premium portion of my site. I have the following query: PHP Code:

$users = mysql_query("SELECT * FROM user WHERE username='$username' AND membergroupids=ཛྷ'");

With this query my login works for those who have signed up for the premium content on the forum. One problem is if the members join multiple user created member groups, they're membergroupids will be like 32,10,34. I need my query to find if they belong to 32 and if so allow them access. So, if they belong to 32,10,34 then they should be allowed to enter, but if they belong to 10,34 they should not.

View Replies !
Looping Through Comma Delimited String?
I'm wondering how I can loop through a comma delimited string in php?

my string: $string = "12499, 12498, 12497";
though the size will change depending on the query.


View Replies !
Comma Delimited Csv Has Commas Inside Fields
I need to import a CSV file into a database daily. That operation in itself is simple enough but the trouble is that some fields are quoted because they have commas inside them. How do I handle this with my import script?

It would be much better if the CSV was created with all fields quoted or used a different delimited but sadly that is not an option.

View Replies !
Regular Expression For Comma-delimited Pairs
I have a textarea form field for inputting (or pasting) pairs of data.

I need a regular expression pattern to validate each line for the following

double quote
number
double quote
comma
double quote
alpha string
double quote
carriage return

The following comes close, but doesn't check for a carriage return at the
end of each line:

^"([0-9]?)+"([,]s?"([A-Za-z0-9]+)")*$

For example the following would return true:

"1","John"
"2","Paul"
"3","George"
"4","Ringo"

View Replies !
Reading Excel To MySql Or Comma Delimited ...
right direction on how to deal with an xls
flie.

but the only other file I have to work
with is pdf.

I'm not sure, is xls the better of two evils?


View Replies !
Stripping Quotes Out Of A Comma Delimited File?
I have a flat file that I'm trying to stick into a MySQL database. One
record per line, multiple fields per record, and many of them are null
fields which are just double quotes without a space between. It's probably
nothing really major for people who have done this before, but I'm a bit
stumped. The file is comma delimited. Every field is surrounded by double
quotes. I've done quite a bit of searching, on the php site and elsewhere,
but I can't seem to get it to strip the quotes out so I can explode the file
line by line to grab the fields.

View Replies !
Set An Array = To A Comma Delimited String Of Strings
is there anyway I can set an array = to a comma delimited string of strings and then loop through each of those manipulating the string. help me with the basic code for setting up the array and looping through it.

View Replies !
Converting Comma Delimited Field Into Array
I have an array that goes into a MySQL database (via PHP). The only way I could find to insert them into the database was using implode. It goes into the database just great, comma separated (although I would like each to go into it's own field, but it's okay for now).

The problem comes when I try to display it. Since it's comma delimited it display only the first item in the array. But there are multiple rows that should be displayed.

I'm not sure how to explode it so that it will display them all. I've tried a loop but that just looped the first item in the field (the first part of the array). Code:

View Replies !
File Parsing Function For Tab Or Comma Delimited Files
I need a way to parse a file based on the delimitation of either tab or comma. Does anyone know the best way to do this that is the easiest? Also the file I am parsing might have a few empty strings between delimitation. I know about preg_split so if this is the only way could someone provide a link that explains regular expressions because i dont get it.

View Replies !
Create A Comma Delimited String That I Can Convert To An Array Using Explode();.
I am attempting to create a comma delimited string that I can convert to an array using explode();. I have the following code: Code:

$cPath_new_a = tep_get_path($categories['categories_id']);
$cPath_new_b = str_replace("cPath=", "", "$cPath_new_a");
$cPath_new_c = str_replace("_", "", "$cPath_new_b");
$cPath_new_d = substr("$cPath_new_c", -2, 2);

$cPath_new_e = $cPath_new_d . ",";

echo $cPath_new_e;


This outputs 23,53,

I need it to output 23,53 Using the substr($cPath_new_e, 0, -1); and/or rtrim() method to remove the last character for some reason removes all of the commas. Am I approaching this the right way?

View Replies !
MySQL: Searching With Joins Or Delimited List
I'm trying to implement a solution where a given company can set a list of the coutries in which it has branches.

My first thought is this:

'company' (id, co_name)
'location' (id, co_id, loc_code)

And when the customer want to know if a company has a location in Belize:

select c.co_name from company c left outer join location l on l.co_id = c.id where l.loc_code = 'BZ'

My second thought is adding loc_code to company: Code:

View Replies !
Populating A List Box Or A Dropdown List Using Php And Odbc
I need to populate a list box and/or a dropdown list on a form. I have all
the bits and pieces together, all bar the code which takes the result of a
query and creates a list box.

View Replies !
Re Comma Separated List - Another Question
I can do the match perfectly but what i also need to do is create a third
list of comma separated values that are in both

eg:

List 1 => 1,2,3,4,5,6,7,8,11
List 2 => 1,3,4,5,6,7,10,23

Therefore

List 3 => 1,3,4,5,6,7

How do I populate this third list - I'm really stuck ....

View Replies !
Breaking Up A Comma Seperated List
i have a list seperated by commas: 1. 3. 5. 7. 9 actually is a varible

$members ="1, 3, 5, 7, 9"; what would be the best way to break that up to insert the values into a table in a loop.

View Replies !
Comma Seperated List Comparison
is it possible to compare acomma separated list aginst another

eg comma list 1 => 1,2,3,4,5
comma list 2 => 3,5
can you check that 3 is in both, and 5 is in both, therfore they match?

the comparison is to check that if product a who supplies products 1,2,3,4,5
can be used instead of product b who supplies 3,5 as product a already
supplies them

View Replies !
How To Remove Last Comma From A Multiple List?
I have a multiple select list in my site where the values are inserted in a database table, in a column named available_country. I enter these values in the db separated with comma. I don't know however how to remove the last comma so it will be something like this:

USA, Europe, Asia

and not:

USA, Europe, Asia,

Here's what I tried but it didn't worked: ...

View Replies !
Meaning Of Comma After Bracket Eg. List(, $value)
i cant find what this means when you have a comma after a bracket as in for example

php list(, $value)

anyone could explain why that comma is there or at least what its called so i can read about it?

View Replies !
Comma Separated List In MySQL Field
say I have a list of categories in a field, and a page that is supposed to pull from the db based on a category. Is there any way I can do a query where it searches the contents of that field for the category in question?

like SELECT FROM table WHERE category = $category  but have it search the category field (the comma separated list for each entry) for the $category var

View Replies !
Array Form A Comma Delineated List
What's the best way to create an array from a comma delineated list?

I have a string assigned to a variable that looks like this: 1,2,3,4

And I would like to create an array so that $arr[0] = 1 and $arr[1] = 2 etc.

It seems so simple but I just can't crack it.

View Replies !
Dropdown List
I have a Dropdown list with Select with 1, 2, 3, 4, after select on of them it bust to refresh the page to what you select but it don't do it. PHP Code:

View Replies !
Dropdown List Box
I am able to populate data in a dropdown list box using php and mysql. However, I a wondering if i can add inside some icons such as close or More records,  where the drop down acts to the specified request, ie., closing the drop down or fetching  some more data from backend.

View Replies !
Populating Dropdown List
I am wanting to know how to populate the <SELECT> dropdown menu with all existing values from the DB and also have the value associated with that id selected. This is an updating area of my admin. Any ideas? Here's the code so far. At the moment it only retrieves the value assigned to that id. PHP Code:

View Replies !
Smarter Way Of Doing Dropdown List?
I've got a dropdown list that is acting as a filter on a table, so the user can select a value and the page is reloaded only showing the matching values from the database.

Now when the page reloads the dropdown was set to 'all' as it was first in the list, even if I'd selected a different value, this was confusing for users, so I added an initial <option> field which pulled the correct value from $_GET (code below) - however this is a little odd as it means the value appears twice!

Does anyone have a genius solution to this?  I've seen a <select selected="yes"> sort of thing around, but I don't know how I can tell the php to add this value dynamically? 

<select size='1' name='occupation'>
<option>".$_GET['occupation']."</option>
<option value='All'>All</option>
<option value='Student'>Students</a></option>
<option value='Professional'>Professional</option>
<option value='Hobbyist'>Hobbyists</option>
</select>

View Replies !
Mysql Dropdown List
Im trying to automatically fill a dropdown list with data from MYSQL table.

Sizes Table
--------

ProductId | size1 | size2 | size3 | size4 | size4 | size6 |

* the 'size' rows hold a numeric value for the quantity I have of each

I was hoping to only list the sizes that have a greater number than 0.
I have used an auto fill select code on another project but I'm just not sure how to fill in the blanks. Code:

View Replies !
List The The Entries Of The Dropdown Box
How can I list the the entries of the dropdown box (which are all populated) according to the time they are populated.

View Replies !
Check The Dropdown List
i have a drop down list in my php code. i need to check the drop down list is set or not. for that what is the code. i heard that there is no php code for that. javascript is needed. my code is here. PHP Code:

<?php
$database="sms";                    /* DB name       */
$host="localhost";
$user="root";                        /* Set DB Username */
$pass="";                            /* Set DB password*/
mysql_pconnect($host,$user,$pass);  /* DB connect....*/

mysql_connect ($host,$user,$pass);

mysql_select_db($database) or die( "Unable to select database"); /*DB Select*/

function orgresult()
.......

View Replies !
Add Variables To Dropdown List
I have a list of variables:

$variable[0]
$variable[1]
$variable[2]

The amount of variables changes so i've used $total = count($variable) to find the amount there are.

How would i tell php to create a dropdown menu with the amount of options=$total and then fill the options with $variable[0] etc.

I know i can use a loop to increase the value of say $i by one each time to that i can use $variable[$i] each time, i'm just stuck with adding the whole thing to a dropdown menu with the right number of option...

View Replies !
Autopopulate Dropdown List From Database
An events-registration page with a form containing a dropdown list for upcoming events, the events will be pulled from a table which is updated by...?

what i've gathered so far is that this can be done with PHP. I am a little unclear on the concept of how this is done. How does the updated information get input into the table?

1) can this be done (updating database) through a web interface by the client, or is it something i would have to do locally and then upload. If done by the client, can he delete/edit existing information--assuming he is not familiar with code.

2) what other things aside from html(good), sql(so-so), and php(newb) will i have to know?

i've seen a lot of good tutorials here and will have access to the necessary software. I just want to know if there is anything else i should know before i dive in head first without testing the PHP water, which i assume is frigid.

View Replies !
Dropdown List Of Files In Folder
I am preparing a form that includes a drop-down list consisting of the names of files in a certain folder on the server.

I only need to trap the file name (jpg), not the path and I'm not trying to upload the files or anything - simply allow the user to select one of a number of different image files (they're actually location maps).

View Replies !
Dropdown List - Trying To Get Default Populated From Db.
Nooby question but when I try and get this to work (it should identify which
rows in the database have GK, MID, DEF, FWD against them and then put
SELECTED into the option value to give a default of what the entry is
currently) it just adds SELECTED to all the results as if $row["Position"]
is returning true against all four conditions? What am I doing wrong? CODE:..

View Replies !
Cascade Dropdown Or Conditional List
I would like to create a conditional cascade form.  based on the selection, it can display or not display an input form for the user to enter an string of text. then at the bottom of the page (or when a user submit) connect all the sections including the input field all together (it's like a story maker?)

View Replies !
Microsoft Access Dropdown List
l am building a new site using PHP which has a lot of pages pulling from an Access Database. I would like to have a dropdown list that pulls exhibitions from the database and then when the user selects one it shows the rest of the details from DB just below the dropdown list, hope that makes sense. Code:

View Replies !
Trying To Create Dropdown Menu From List
I am trying to create a dynamic dropdown select menu from a directory containing other directories and files. This is to select a certain page from the list so I can edit it. I only want the files in the menu. Here's what I have so far but it doesn't populate the dropdown. Code:

View Replies !
How To Create A Dynamic Dropdown List
how to create a Dynamic drop down list using Mysql.

View Replies !
Dynamic Dropdown List Using Access
I am creating a dropdown list that is populated from an Access DB: Code:

View Replies !
Dropdown List Selected By Default?
Does any one know how to have an item in the dropdown list selected by default?

$city_field = HTML_QuickForm::createElement('autocomplete', 'city', 'City', $cities);

$cities is an array of city names and I would like, say 'Los Angeles' selected by default.

View Replies !
Dropdown List - Insert Into Mysql
I simply want to add a dropdown list where, when an option is selected, its value will be inserted into a dbase table. More specifically, asume there is a page where the user sees his order.

He will be able to select the order status (pending or delivered). So, for example, if his ordered is deleivered, by selecting "delivered" option, "delivered" will be inserted into the 'Status' column. Code:

View Replies !
Change List View To Dropdown Menu
Im working on a script that has to be change so a user can choose from a dropdown menu instead of a list that now is displayed.
Here is the part that is insert on the index page.

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 !
Stuck On Dropdown Menu List, Could Use Some Guidence
I have a form with some drop down list/menus. I do a check for ommissions and if found display a message to re-try. What I need is a way to show which options where chosen when the user submitted the form the first time.

If someone could show me how to do the first one, I'm sure it's the same process for the second one. Here's the 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 !
Creates A Dropdown List Of Information Belonging To That User.
I have a page that uses php to look up specific fields in a specific table of a specific database based on the username. Using this, it creates a dropdown list of information belonging to that user. The fields in question each have 13 pieces of data. Based on what they click in the dropdown box, I need that specific data to pass onto hidden fields on the page. Code:

View Replies !
Pick From A Drop Down List That Automatically Gives Options In A Second Dropdown Box
does anyone know how to create a form that allows the user to firstly pick from a drop down list that automatically gives options in a second dropdown box. eg.

'category1'
is selected from dropdown box 1,
this then populates dropdown box 2 with the options
'category1.a' or 'category1.b'

or if
'category2'
is selected from dropdown box 1
then dropdown box 2 gives the options of
'category2.a' or 'category1.b'

i f any one knows how I should code this please help, if not point me in the direction of a tutorial that can.

View Replies !
Dropdown List Which Selects A Post A Title (to Edit)
I want to have a dropdown list which selects a post a title (to edit), then when you click submit I want to use POST to submit the data for that post (post title, username, subject, content) so that the edit pages form fields will already be filled with the posts data.

View Replies !
Easy Way To Make "pages" From A Database List
If I list all the rows in a database and "LIMIT 20", how do I make it so I can go to, the next 20 rows? Say if I have 50 rows, and only want to show 20 per a page?

View Replies !
Easy Form Mailer That Is Clean Looking And Easy To Edit.
I have been looking for really easy form mailer that is clean looking and easy to edit. I also am looking for required fields, ect. I have looked all over hotscripts and I really cant find what i'm looking for, anyone else have an idea where i can find what i'm lookin for?

View Replies !
Easy Easy Question (Field Type)
I have built a little MySQL / PHP forum, and was wandering how to incresae the storage of the main message from 255 characters to a lot more, which field type am I after?


View Replies !
Dynamic Dropdown And Hardcode Dropdown In Select Form
I have plenty of examples of dynamic dropdown choices but none of hardcoded dropdown choices. The ultimate goal is to have a job with various tasks and to track the status of those tasks for a given job. I've used one of the tutorials here to begin the process. Below is the code I have to add work on a given task. Perhaps I actually need to "Update" a job as opposed to "add".

But the problem of the moment is I can't seem to hardcode one set of my options. This is the code I have: PHP Code:

View Replies !
FLV Converter With Php
Somedy know how to convert avi, mpg or other video files in flv format,
with PHP script?

View Replies !
3gp Converter
Hi, does anyone knows where to get a script that allows you to convert video to 3gp format for mobile. I would like to have a script that could convert video file to 3gp format. anyone can help me with this script. I just want to convert to 3gp format and nothing else. Just take that site as an example pf 3gp convertion.

View Replies !

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