Convert database attributes into record using PHP

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mostafijur
    New Member
    • May 2007
    • 12

    #1

    Convert database attributes into record using PHP

    Hello

    I need to convert database attributes into Records using PHP. For example

    My database attributes are like :
    [Name varchar(25), Roll integer, Number integer, Percentage real]

    C like structure:
    [code=c]struct Info
    {
    char Name[25];
    int Roll;
    int Number;
    float Percentage;
    }

    Struct info Information[100];[/code]

    I need to put each row data from database to the structure array.

    Question:
    1. Is it possible to code it in PHP ?
    2. If possible please can u help me... how?

    Advance Thanks
    Last edited by pbmods; Dec 24 '07, 01:07 AM. Reason: Added CODE tags.
  • pbmods
    Recognized Expert Expert
    • Apr 2007
    • 5821

    #2
    Heya, mostafijur.

    Check out PHP Classes.

    Comment

    • gasfusion
      New Member
      • Sep 2006
      • 59

      #3
      you can use object collections, a feature of PHP 5, to achieve this. This is something i am currently working on myself.

      Comment

      Working...