TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 06-02-2008, 02:26 PM   #1 (permalink)
The Acquainted
 
Dave's Avatar
 
Join Date: Apr 2008
Posts: 110
Thanks: 97
Dave is on a distinguished road
Default Assigning variables and their values from ARRAYS

I have the following array from a mysql_query():

Array ( [0] => 1 [1] => 4 )
Array ( [0] => 2 [1] => 19 )
Array ( [0] => 4 [1] => 18 )
Array ( [0] => 5 [1] => 5 )
Array ( [0] => 6 [1] => 7 )
Array ( [0] => 7 [1] => 19 )
Array ( [0] => 9 [1] => 6 )


Numbers 1 - 9 represent math instructional units, and numbers 4, 19, 2, etc., represent the number of test items within each unit.

Note that there are no units for 3 and 8.

From the array, I want to derive a group of variables (units) and assign them to the number of items in each group. Example:

$mUnit1 = 4
$mUnit2 = 19
$mUnit4 = 18
.....etc.

I've tried and tried...and tried...but I don't have the chops to do this. (At the rate I'm going, I will by 2012.) Any help would be appreciated!

Dave
Dave is offline  
Reply With Quote
 



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 11:47 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design