Re: [PHP-DB] Array question

2003-11-25 Thread CPT John W. Holmes
From: ShortStay [EMAIL PROTECTED]

 How do you delete a value and key from an array?  I know the value.

You need to know the key.

unset($Array[$key]);

There are various array functions that'll find the key for you if you know
the value.

 Is it OK to post array questions to the db list?

Not really... use php-general

---John Holmes...

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Array Question

2003-06-03 Thread Boa Constructor
Hello everyone.  If I wanted to pass a item ID along with a quantity to an
associative array called CartArray how would I pass it to the PHP script?

I'll get this shopping cart working yet !!

Cheers,

Graeme :)


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] Array Question

2003-06-03 Thread Gary . Every
CartArray['itemid'] = $itemid;

note
where $qty = CartArray['qty'];
/note


Gary Every
Sr. UNIX Administrator
Ingram Entertainment
(615) 287-4876
Pay It Forward
mailto:[EMAIL PROTECTED]
http://accessingram.com


 -Original Message-
 From: Boa Constructor [mailto:[EMAIL PROTECTED]
 Sent: Monday, June 02, 2003 2:27 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Array Question
 
 
 Hello everyone.  If I wanted to pass a item ID along with a 
 quantity to an
 associative array called CartArray how would I pass it to 
 the PHP script?
 
 I'll get this shopping cart working yet !!
 
 Cheers,
 
 Graeme :)
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


Re: [PHP-DB] Array Question

2003-06-03 Thread Boa Constructor
RE: [PHP-DB] Array QuestionCheers Gary, and in the html would I put something like:

a href=myscript.php?itemid=1qty=2buy this item/a

Simple question I know!


Jay, yup thats all I want to do, just assign two values into an array.


Thank you,

Graeme :)
  - Original Message - 
  From: [EMAIL PROTECTED] 
  To: [EMAIL PROTECTED] ; [EMAIL PROTECTED] 
  Sent: Monday, June 02, 2003 8:30 PM
  Subject: RE: [PHP-DB] Array Question


  CartArray['itemid'] = $itemid; 

  note 
  where $qty = CartArray['qty']; 
  /note 



  Gary Every 
  Sr. UNIX Administrator 
  Ingram Entertainment 
  (615) 287-4876 
  Pay It Forward 
  mailto:[EMAIL PROTECTED] 
  http://accessingram.com 



   -Original Message- 
   From: Boa Constructor [mailto:[EMAIL PROTECTED] 
   Sent: Monday, June 02, 2003 2:27 PM 
   To: [EMAIL PROTECTED] 
   Subject: [PHP-DB] Array Question 
   
   
   Hello everyone.  If I wanted to pass a item ID along with a 
   quantity to an 
   associative array called CartArray how would I pass it to 
   the PHP script? 
   
   I'll get this shopping cart working yet !! 
   
   Cheers, 
   
   Graeme :) 
   
   
   -- 
   PHP Database Mailing List (http://www.php.net/) 
   To unsubscribe, visit: http://www.php.net/unsub.php 
   


Re: [PHP-DB] Array Question

2003-06-03 Thread CPT John W. Holmes
 Hello everyone.  If I wanted to pass a item ID along with a quantity to an
 associative array called CartArray how would I pass it to the PHP
script?

 I'll get this shopping cart working yet !!

If the question is how do you pass an array to another PHP page, you
serialize() and urlencode() it, then pass it in the URL. On the following
page you unserialize() it.

---John Holmes...


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] array question

2003-06-02 Thread John Coder
After Wracking my brain for too long on this I decided to give in and ask.
I have holes in an array that came from a database. I put the holes there with 
unset some values so no prob. Now I need to fill the holes. Below is what I 
have and what I need for further manipulations.

Array
(
[0] = Array
(
[0] = Completed
)

[1] = Array
(
[1] = In Progress
)

[2] = Array
(
[0] = Completed
)

[3] = Array
(
[0] = Completed
[1] = In Progress
[3] = Deferred
)
 What I need is:
Array
(
[0] = Array
(
[0] = Completed
)

[1] = Array
(
[0] = In Progress
)

[2] = Array
(
[0] = Completed
)

[3] = Array
(
[0] = Completed
[1] = In Progress
[2] = Deferred
)
Hope this makes sense

John Coder

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Array question

2002-11-08 Thread nikos
Does anybody know how to remove an item from an array?
Let's say

$array('banna', 'apple','cherry')
foreach ($array as $value) {
if ($value=='chery') DELETE $value FROM $array
...

Thanks




Re: [PHP-DB] Array question

2002-11-08 Thread Maxim Maletsky
to precise:

$array = Array('name'='Maxim', 'surname'='Maletsky');

unset($array['name']);

// now array has this structure:
// Array('surname'='Maletsky')


--
Maxim Maletsky
[EMAIL PROTECTED]



Jason Wong [EMAIL PROTECTED] wrote... :

 On Friday 08 November 2002 17:25, nikos wrote:
  Does anybody know how to remove an item from an array?
  Let's say
 
  $array('banna', 'apple','cherry')
  foreach ($array as $value) {
  if ($value=='chery') DELETE $value FROM $array
  ...
 
 unset().
 
 
 -- 
 Jason Wong - Gremlins Associates - www.gremlins.com.hk
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *
 
 
 /*
 Kiss me, Kate, we will be married o' Sunday.
   -- William Shakespeare, The Taming of the Shrew
 */
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php