Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,208,841 members, 8,004,019 topics. Date: Saturday, 16 November 2024 at 06:14 AM |
Nairaland Forum / Science/Technology / Programming / Simple Array Problem In Php (1516 Views)
Please Help With An Array Problem / Php Array Problem [SOLVED] / Converting Picture To Byte Array(blob) And Back To Picture (2) (3) (4)
Simple Array Problem In Php by leastpay(m): 9:47am On Dec 05, 2012 |
i want to count the number of order a customer has made by using an array which i know is d method. List of items are display in a checkboxes. After a customer have selected an items , he click the "add to cart " to display number of items and goods selected. I tried to use count() but it display all element in d array. Thanks for your help. |
Re: Simple Array Problem In Php by bakenda(m): 10:44pm On Dec 05, 2012 |
How did you use count(), let's see some of your code. 1 Like |
Re: Simple Array Problem In Php by albertjr: 1:57pm On Dec 06, 2012 |
PHP is server side scripting language. It is use for designing web page. PHP may be deployed on most internet servers and additionally as a standalone shell on nearly each operating system. importance of education in islam the importance of education in islam muslim education |
Re: Simple Array Problem In Php by cmespeak: 3:46pm On Dec 06, 2012 |
albertjr : bros y d lecture,pls solve the guys problem. |
Re: Simple Array Problem In Php by Bossman(m): 4:55pm On Dec 06, 2012 |
I do not know PHP, but what you are trying to do applies regardless of language. Can't you just declare a count variable, and add to it (whatever is entered as the number of items) when ever the user ads an item to the cart, and deduct from it when an item is removed. If you want the number of items for each item type, then you can use a map (or something similar in php). because you will need to store the count for each item type. OTOH, you can use 2 arrays - one will store the item type and the other will store the count associated with that item. Then just use the position within the array to identify an item and its associated count. |
Re: Simple Array Problem In Php by leastpay(m): 8:10am On Dec 07, 2012 |
please download and check out the php script i wrote n make necessary correction 4 me thnks
|
Re: Simple Array Problem In Php by Nobody: 9:02am On Dec 07, 2012 |
leastpay: please download and check out the php script i wrote n make necessary correction 4 me thnks copy and paste it here. moreover, who codes in microsoft word anyway? |
Re: Simple Array Problem In Php by leastpay(m): 11:06am On Dec 07, 2012 |
i'm using a phone to browse, meaning i can't paste the code here.so download if u are browsing from a pc.thnks |
Re: Simple Array Problem In Php by AZeD1(m): 5:12pm On Dec 07, 2012 |
Declare a variable v and initialize it to zero the loop through the array and add 1 to v. |
Re: Simple Array Problem In Php by Vijon(m): 9:30pm On Dec 07, 2012 |
hi @all,plz who can help me wit php ebook or video tutorial.email is vijononline@gmail .com.tanks |
(1) (Reply)
Ifiok Nkem Gives Away His Joomla Extension Development Course For FREEE / Mail Crypt - Safest Way To Send Vital Information / 13 & 15 Years From Nigeria Built Mobile Web Browsing Alternative To Google Chrom
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 12 |