Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mysql_fetch_array with multidimensional arrays

Status
Not open for further replies.

james6848

Technical User
May 10, 2004
23
GB
I'm familiar with using 'while' to extract data from a MySQL derived array using a $row[] variable, but if I want to extract from a multidimensional array do I just use the construction $row[0][1] (for example)?

Thanks.
 
OK! Sorry.
I want to put my CV on the 'net. For each previous job I need a single array, something like this:

Job1 (task1 => details, task2 =>details, task3 => details)
Job2 (task1 => details, task2 =>details, task3 => details)
etc...

Then I want this to exist in a multdimensional array called 'experience':

Experience (0 => Job1, 1=> Job2, etc...)

My two problems are:
1-Getting this info into a multidimensional array from a MySQL database. Can I construct this with the mysql_query() function, assuming there is a separate table for each job?
2-Echoing each element of the md array on the page. Can the mysql_fetch_array() function deal with multidimensional arrays?

Hope that's a bit clearer.
 
you have to do like:

Code:
$res = mysql_query($selec_str);
$experience = array();
while ($row = mysql_fetch_array($res))
{
    array_push($experience, $row);
};

//look at $experience;

___
____
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top