Jump to content

TheRealPage

New Members
  • Posts

    4
  • Joined

  • Last visited

Posts posted by TheRealPage

  1. 4 hours ago, Psycho said:

    I would be interested to know WHY you are wanting to do this. What are these "duplicate" records for and if their data is the same as the 'parent' why do you need to refer to the parent for the data? Also, since each element doesn't have a defined index I'm not sure how you want to make the reference. Do you just want to store the first element value (e.g. '10') in the child element? This would be a lot easier to work with if the elements also had named indexes. Anyway, here is a possible solution. Note, once you run this IF you change one of the referenced values in a parent element it WILL be reflected in the child elements.

     

     

    ten, dix, diez are all 10 in different languages.. all contain the same datas... just want to simplify the thing by updating 1 place!

    Thanks for the answer, I'll take a look and adapt it!!!

     

    -TRP-

     

  2. 7 hours ago, chhorn said:

    I don't understand what you want, post a reproducible example.

    I have...

    array (
         array("10", 25, 31, "Yes", "No"),
         array("20", 21, 18, "No", "No"),
         array("30", 11, 47, "No", "No"),
         array("40", 14, 60, "No", "No"),
         array("ten", 25, 31, "Yes", "No"),
         array("dix", 25, 31, "Yes", "No"),
         array("twenty", 21, 18, "No", "No"),
    );

    I would like to do...

    array (
         array("10", 25, 31, "Yes", "No"),
         array("20", 21, 18, "No", "No"),
         array("30", 11, 47, "No", "No"),
         array("40", 14, 60, "No", "No"),
         array("ten", [refer to 10] for other datas),
         array("dix", [refer to 10 for other datas]),
         array("twenty", [refer to 20 for other datas]),
    );

  3. I'm very beginner with arrays.... i KNOW, databases exist, it's more easy.. I can't use a database.. I have to use, this.. or similar.. that doesn't requiring a database engine... 

    So... that array...

    array (
         array(string, int, int, string, string),
         array(string, int, int, string, string),
         array(string, int, int, string, string),
        ....+250
         array(string, int, int, string, string)

    );

    I search by the element [#][0].. in the +250 some will contain the same infos and I would like to make them point to the element containing the info instead of repeating it and have to update at 3-4 places when it's time. Like what it's in "10" also good for "ten", "dix" and "diez"...

    anyway to make that simple?  by reference or...???

    I'm crying.. last time I used arrays... Turbo Pascal.. at school... or was it Turbo C++ 3.0?? Maybe it was with cobol... well it was the good ol' time of the 90s!

     

    Thanks!

     

    -TRP-
     

     

     

  4. Hiya'll!!

    Like the title says, I'm not new with PHP, I'm coding since 1997 in many languages.. I started PHP scripting about 10 years ago.. maybe a bit more.. always kept it basic.. I script usually stuff with arrays and files, I used to use a lots databases.. less now because what I'm doing is more easy with files...

    I still need more help then I can provide.. for now.. by getting help I can improve and provide more then I need!

    See you around! :)

     

    -TRP-

     

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.