PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Coding

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old August 11th, 2002, 05:18 AM
Emperor_Jazzy Emperor_Jazzy is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Melbourne, Vic, Aus
Posts: 7 Emperor_Jazzy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Array Classes

I have defined a class called order and definied a new variable using this class (as an array).

class order
{
var $pr_code;
var $pr_quan;
}

$ord_item = array();
$ord_item[] = new order

Now that I've defined these, I want to save the information into the variable class.

So far I'm looking at the following code:

array_push($ord_item, $ord_item->pr_code = $pr_code, $ord_item->pr_quan = $pr_quan);

I have not tried this code as it does not look right. Is there a certain way of adding a new order to the end of the array and store both class values?!

Assistance Would Be Great

Reply With Quote
  #2  
Old August 11th, 2002, 10:56 AM
Gipz Gipz is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Stockholm, Sweden
Posts: 98 Gipz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via ICQ to Gipz
RE: Array Classes

You must do something like:

php Code:
Original - php Code
  1.  
  2. <?php
  3. class order
  4. {
  5.     var $pr_code;
  6.     var $pr_quan;
  7. }
  8.  
  9. $ord_item = array();
  10. $ord_item[0] = new order();
  11. $ord_item[0]->pr_code = 'code';
  12. $ord_item[0]->pr_quan = 'quan';
  13. ?>

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > Array Classes


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway