Reply
HeLp! Assigning Variables in a For statement based on the Counter
Old 04-14-2007, 09:46 PM [solved]
Average Talker

Posts: 23
Problem Solved.thanks!

Last edited by mattgoldman : 04-17-2007 at 05:27 PM.
mattgoldman is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 04-15-2007, 04:58 AM Re: HeLp! Assigning Variables in a For statement based on the Counter
damien_ls's Avatar
Ultra Talker

Posts: 433
Name: Damien
Maybe create an array, and use the counter variable $i as your key?

PHP Code:
for($i=1;$i=3;$i++)
{
    
$classes[$i] = new paintingInfo();
    
$classes[$i]->classtitle $title;
    
$classes[$i]->classtype $type;
    
$classes[$i]->classdescription $description

Perhaps something like that may do it?

However, I don't quite understand; aren't you creating the same class over and over in that case - so won't you just get the same results 3x?

Perhaps I'm missing something due to the simplifications to post the problem here? Hope the above might help anyway...
__________________
Layershift :: DDS & Dedicated, UK & USA-based Managed Virtuozzo VPS, Reseller & Shared Hosting
Experienced Parallels Platinum Partners (Plesk since 2001, Virtuozzo since 2004)
damien_ls is offline
Reply With Quote
View Public Profile
 
Old 04-15-2007, 12:39 PM Re: HeLp! Assigning Variables in a For statement based on the Counter
Super Talker

Posts: 123
Name: Nick Mallare
You can do something like this [I believe]:

PHP Code:
$myvariable$i blah
Nick
nmallare is offline
Reply With Quote
View Public Profile Visit nmallare's homepage!
 
Old 04-16-2007, 04:51 AM Re: HeLp! Assigning Variables in a For statement based on the Counter
Average Talker

Posts: 23
Thanks Problem Solved

NEVER, NEVER, NEVER delete your original question when you solved your problem - The beauty of having a forum like WT is having an entire community learn by example and feedback of others

Last edited by mgraphic : 04-16-2007 at 08:19 PM.
mattgoldman is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to HeLp! Assigning Variables in a For statement based on the Counter
 

Thread Tools

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.12750 seconds with 13 queries