[PHP] php mysql array question

Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default Re: [PHP] php mysql array question

    > Is there any php function to pull a query into an array? I know there is
    a
    > way to get the first row of the results in an array, but I'm having to
    loop
    > through each row pushing the row onto an array to get the result I'm
    looking
    > for and it seems like a lot of code for something that I would think is
    used
    > a lot.
    There's no PHP function to do so. Some abastraction layers provide this, but
    it's just doing a loop like you're doing.

    Show your code and we can offer tips on how to improve performance.

    ---John Holmes...

    Cpt John W. Holmes Guest

  2. Similar Questions and Discussions

    1. mySQL and Array
      Hi all- I have defined an array using: <cfset notesattached = ArrayNew(1)> and added some data like this: <cfset notesattached = 4>...
    2. MySQL Table Question > Array?
      I'm programming a Gaming Ladder/Tournament system. Let's say I have the following tables: PLAYERS ------- * Player_ID * Player_name .... *...
    3. array question (grep -v on array)
      Hi, I have an output of errors fed into an array, after which I only look at things I care about and put them in a different array: ...
    4. HOW TO -- ARRAY UPDATE MYSQL
      HI ALL, I want to update a mulitple row from a HTML Table to MYSQL Database. L1 V1 T1 L2 V2 V2 L3 V3 V3 Any help in this regard is much...
    5. php mysql array question
      I use the PEAR db http://pear.php.net/manual/en/package.database.php This returns arrays - examples here...
  3. #2

    Default Re: [PHP] php mysql array question

    On Fri, 11 Jul 2003, CPT John W. Holmes wrote:
    > > Is there any php function to pull a query into an array? I know there is
    > a
    > > way to get the first row of the results in an array, but I'm having to
    > loop
    > > through each row pushing the row onto an array to get the result I'm
    > looking
    > > for and it seems like a lot of code for something that I would think is
    > used
    > > a lot.
    >
    > There's no PHP function to do so. Some abastraction layers provide this, but
    > it's just doing a loop like you're doing.
    >
    > Show your code and we can offer tips on how to improve performance.
    I'm glad this feature doesn't exist. Just think how abused it would
    be, how many people would use it, when few would actually need it.
    Most people can use the data while in the loop, not after. Or do
    what is needed in the sql, not php. Maybe I'm a little too parental
    though, but so be it. :)

    Regards,
    Philip

    Philip Olson Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139