Professional Web Applications Themes

Question about reading data I've created with , delimiter - MySQL

Usually I get a answer in alt.php concerning MYSQL :-) :-) I've reposted the question below, I have a very large and complex environment, and this is just the thing I need to do. Can someone please show a working example? How does the explode() command help me pull back #5 data slot? Thank you for your patience and anyone can help that would be great. ----------- Hello, could someone please show me how to do this. In a single cell in a DB column, I can have multiple kinds of data squeezed together delimited by a comma. like ..... ...

  1. #1

    Default Re: Question about reading data I've created with , delimiter

    Usually I get a answer in alt.php concerning MYSQL :-) :-)

    I've reposted the question below, I have a very large and complex
    environment, and this is just the thing I need to do. Can someone
    please show a working example? How does the explode() command help me
    pull back #5 data slot? Thank you for your patience and anyone can
    help that would be great.


    -----------

    Hello, could someone please show me how to do this.

    In a single cell in a DB column, I can have multiple kinds of data
    squeezed together delimited by a comma.

    like .....
    "datagreen,datablue,dataorange,datawhite,datayello w,datared,datablue, ...
    "

    If I read that data and have it in a string like $datastring...... how
    do I put it into a array situation? to access that data.... so if I
    want to know what is in spot 5 only, and return back 'datayellow' for
    instance, how do I do that? :-) I don't know if array is the right
    word, I just want to be able to access any part of that string based
    on the order it is in.

    Thank you!

    Rebecca

    rebeccatre@gmail.com Guest

  2. #2

    Default Re: Question about reading data I've created with , delimiter

    com wrote: 

    Do you get your oil changed at McDonald's?

    Ask in the correct place and you get better answers. php newsgroups are
    for PHP, mysql newsgroups are for MySQL.
     

    As I told you in comp.lang.mysql - first of all, normalize your
    database. You're in violation of First Normal Form,.

    Normalization is a defined series of step you should use to create a
    database. Among other thing, it prevents problems such as the one
    you're experiencing.

    In your case you need another table consisting of two columns - one with
    the record id of the first table, and the second with *one* value from
    your list. Add as many values as you need.

    PHP newsgroups removed from the list.

    --
    ==================
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    net
    ==================
    Jerry Guest

  3. #3

    Default Re: Question about reading data I've created with , delimiter

    ..oO(com)
     

    Did you actually read the manual page for explode()? Using it is pretty
    easy - you feed a string to it and get an array back. The 5th element of
    your string would be the 4th element in the array (zero-based indexes).

    Micha
    Michael Guest

  4. #4

    Default Re: Question about reading data I've created with , delimiter

    On Jul 15, 8:09 pm, Michael Fesser <de> wrote: 

    >
    > Did you actually read the manual page for explode()? Using it is pretty
    > easy - you feed a string to it and get an array back. The 5th element of
    > your string would be the 4th element in the array (zero-based indexes).
    >
    > Micha[/ref]

    Thank you Micha & Vince, this is kinda the theory that I hope to
    figure out. I do understand there is a explode command, but there
    isn't sufficient examples out there (or at least I have not found one
    yet) related to answer what I would like.

    The code example kindly posted by Vince is helpful to understand-see
    the explode() command unravel the string, but it doesn't solve the
    question I proposed. :( I want to be able to only print part of that
    string on demand (5th slot for example).... am I getting close? ;)

    rebeccatre@gmail.com Guest

  5. #5

    Default Re: Question about reading data I've created with , delimiter

    ..oO(com)
     

    No offense intended, but could it be that you're lacking some very
    basics like how to access array elements or to print something out?

    Micha
    Michael Guest

Similar Threads

  1. Problem with Data Grid reading dynamic data
    By OMH Rob in forum Macromedia Flash Data Integration
    Replies: 0
    Last Post: October 19th, 02:51 PM
  2. reading in XML data
    By Goo101 in forum Macromedia Flash Data Integration
    Replies: 4
    Last Post: August 21st, 09:28 AM
  3. Reading DATA
    By VK in forum ASP.NET Web Services
    Replies: 1
    Last Post: August 8th, 11:05 AM
  4. Problem reading layer data error? Composite data instead? WTF
    By Mike_Ornellas@adobeforums.com in forum Adobe Photoshop Mac CS, CS2 & CS3
    Replies: 1
    Last Post: February 11th, 09:29 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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