Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Sep 2002
    Thanked 20 Times in 20 Posts

    array help needed...

    I need help with creating an array.
    I'm getting the mysql column keys using array_keys() but it loads the key name into the array.
    ex: array('id')

    I need it to load the actual key.
    ex: array($id)

    How can I accomplish this?
    NO Limits!! DHCreationStation.com
    For projects using MediaTypes (MIMETypes) visit E-BAM.net -(updated weekly)

    Broken items wanted for tinkerin'! PostItNow@BrokenEquipment.com
    Global Complaint Dept.

  • #2
    New Coder
    Join Date
    Oct 2012
    Thanked 0 Times in 0 Posts
    You have to have the mysql query in an array, and then loop through that array. (say with- "$row as mysql_fetch_array($array)"). Then you can access the id of each row in that array with $row['id']. (As long as you've named the id column, - id -.

    Hope that helps.

    Array_keys() is used to get the key BTW.


    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts