473,549 Members | 2,719 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

pulling mulitple selection listboxes into a PHP array for updating a MySQL DB with

2 New Member
I may be being really stupid here, i have spent the last 3 hours looking round your site and some other for answers to my problem, but have not had much luck (possibly cuase my brain just isn't working today)

I have EasyPHP2.0b1 Apache/MySQL server installed on my Windows XP(SP2) machine. This runs Apache 2.2.3, MySQL 5.0.27 and PHP 5.2.0

I have a PHP code filled listbox, which allows multiple selections.
Actual Values are "rcd_no, cn_no"
Also I have a simple textbox which holds "invoice_no "

I am tying to do several things at once (well i know technically one after another)
1. i need to pull out all the selected values, i am still not sure how the values are stored by the listbox for multiple selctions, and am unsure of how to get the mulitple value selections from the listbox into a PHP array

2. i need to split them to get he rcd_no and cn_no seperate (as they form a Primary key on the table i am trying to update), this i believe should be easier to do in JavaScript nd then in thory done before 1, but was wondering if it was doable in PHP

3. i need to update multiple rows in the database based on the selected rcd_no and cn_no's. with invoice_no. Assuming i should be able to use
[PHP]foreach();[/PHP]
or at worst a standard for loop, pulling the different values for the WHERE clause out and updating the same value (invoice_no) into multiple lines in the DB table.

I have seen several code postings for different bits of these, but can't seem to make my head convert/merge them to what i'm after

I hope this makes sense, there is no code posted cause i'm just completely at a loss atm.

Cheers
Julie
Nov 17 '07 #1
2 2625
ak1dnar
1,584 Recognized Expert Top Contributor
First I'll give you a simple example. This how you can get a listmenu values to a array in php. And I'm sorry your question is not that much clear to me. do you have an example of what you want to happend? I mean any code.

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <body>
  3. <form action="server_page.php" method="post">
  4. <select name="my_list_menu[]" size="3" multiple>
  5. <option value="value1">Disply_value_1</option>
  6. <option value="value2">Disply_value_2</option>
  7. <option value="value3">Disply_value_3</option>
  8. </select>
  9. <input name="" type="submit" />
  10. </form>
  11. </body>
  12. </html>
  13.  
server_page.php
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. print_r($_POST['my_list_menu']);
  3. ?>
EDIT: Hey welcome to TheScripts.com
Nov 17 '07 #2
julie18881
2 New Member
Cheers for the reply,

I have actually managed to fix it now, my coding brain stoped hiding, and i got it to work.

At the time of post i didn't have any code except the standard filling of the listbox with PHP.

Cheers again

Jules
Nov 18 '07 #3

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

Similar topics

1
2066
by: Jean Biver | last post by:
Dear folks: 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...
12
4296
by: James | last post by:
Hi, 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: $carers = array( array('names' => 'Carer 01', 'hours' => 8, 'remaining' => 8),
9
7034
by: Philip D Heady | last post by:
Ok, as some of you may know I'm an Oracle newbie w/ PHP. I'd rather use MySQL but at the office here we use Oracle and boy do I have alot to learn. I'm starting to hate it after using MySQL!! -------------------------------------------------------------------------- 1) Is there a similar statement using PHP/Oracle functions as below for...
3
10427
by: Mark A Framness | last post by:
Greetings, I am working on a project and we need to write a conversion script to initialize a new field on a table. The number of records on this table is on the order of millions so routine selection and update takes a long time. I am tasked with writing a pl/sql proc that utilizes array processing to update the column.
8
2547
by: Galina | last post by:
Hello I have 6 dependent list boxes on my ASP page:  Faculty;  Lecturer;  Course;  Course occurrence;  Group;  Week commencing date. When faculty is selected, lists of lecturers and courses are populated. When course is selected, lists of occurrences, groups and
5
2289
by: Dave H | last post by:
I have an asp:listbox, allowing multiple selections, is there a quick check to see if there's more than one selected, or do I need to go through the whole list? Thanks, Dave
2
4335
by: salad | last post by:
This is a tip on how to speed up listboxes DRAMATICALLY. Persons that would benefit are those that are constantly updating the rowsource of a listbox/combobox in order to filter and sort the data and the refreshes are slow. (OT. I've often wondered why there is no .Sort or .Filter property for Combos and Listboxes.) My listboxes , and...
14
2132
by: bcap | last post by:
Hello, I really would apprciate help! =) What I want to do is be able to change the status of mulitple records using a drop down and a checkbox. I have a drop down called "ChangeStatus" with the values to change the status to Pending, Accepted, Declined, Cancelled, Completed.
4
2556
by: sialater | last post by:
Hello, I realise there are a lot of topics related to this problem but many of what I have found has run cold or unresolved. What I have is an addressbook clone where there are groups which have members. I have this formatted in a way where the groups are in a drop down box. Once a group is selected, the two selection boxes below are refreshed...
0
7720
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7957
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7470
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7809
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5368
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5088
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
1941
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1059
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
763
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.