PHP Array's Question

Posted on 2009-04-23
Last Modified: 2013-12-12
I was able to get the values from a database to an array in PHP. How do I access them now?


([0] => Array ( [class] => PREMIER [name] => B Reach ) 

[1] => Array ( [class] => PREMIER [name] => B Touch ) 

[2] => Array ( [class] => PREMIER [name] => B Identity ) 

[3] => Array ( [class] => PREMIER [name] => B Marq) 

[4] => Array ( [class] => ADVANTAGE [name] => B Linq ) 

[5] => Array ( [class] => ADVANTAGE [name] => B Touch 91 ) 

[6] => Array ( [class] => ADVANTAGE [name] => B Marq 91 ) )

I tried 

echo $array[0][0] but I dont get any display

Open in new window

Question by:mkirtani
    1 Comment

    Accepted Solution

    I got it.

    echo $parray[0]["class"];
    echo $parray[0]["name"];

    Featured Post

    Easy Project Management (No User Manual Required)

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    As this topic comes over and over again in different forms, I've finally decided to write a short (yea, right...) article / tutorial about pagination with PHP with MySQL database. There are dozens of these kind of tutorials, I know - I wanted to mak…
    Both Easy and Powerful How easy is PHP? (  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
    Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    730 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now