Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #12477

Re: Loop through array, change headings

From Jerry Stuckle <jstucklex@attglobal.net>
Newsgroups comp.lang.php
Subject Re: Loop through array, change headings
Date 2013-12-31 20:50 -0500
Organization A noiseless patient Spider
Message-ID <l9vs95$caf$1@dont-email.me> (permalink)
References <XnsA2A7852F61CBEarbpenyahoocom@78.46.70.116> <1muwjkgu5s0oj$.1f9jdj8mm94rc$.dlg@40tude.net> <l9viag$1vp$3@dont-email.me> <pu961g31cbxe$.1q7y2fudnvkb7$.dlg@40tude.net>

Show all headers | View raw


On 12/31/2013 7:19 PM, richard wrote:
> On Tue, 31 Dec 2013 23:00:32 +0000 (UTC), Denis McMahon wrote:
>
>> On Tue, 31 Dec 2013 17:06:38 -0500, richard wrote:
>>
>>> On Tue, 31 Dec 2013 21:08:42 +0000 (UTC), Adrienne Boswell wrote:
>>
>>>> I have a table that has three classifications.
>>
>>>> I have another table that has categories in each classification.
>>
>>> Why not have one table?
>>
>> Richard, you've proved time and time again that you have no understanding
>> of relational database design theory. Please stop trying to suggest that
>> people with sensibly designed databases should do it the stoopid way.
>>
>> Adrienne's query joins the multiple tables into a single dataset and
>> sorts the dataset, the question asked was how to process that sorted
>> dataset in a specific manner. The question has nothing to do with the
>> structure of the data in the database, the answer lies solely in how the
>> result object returned by the mysql[i]->query() is processed.
>>
>> Here's one example of why Adriennes approach is easier:
>>
>> Supposing Adrienne decides to rename one of the three classifications. In
>> Adriennes database, that involves a single sql operation on one row in
>> one table. In your hypothetical and seriously fucked up database design,
>> you would need to test each row in the whole database to see if the
>> category was the one that needed to be changed, and then change it. Such
>> a process is highly inefficient in terms of both cpu effort, memory
>> management and disk io, and it is to prevent such inefficiencies amongst
>> other things that relational database design theory has evolved to where
>> it is today.
>>
>> Unlike your comprehension of computer systems which appears to have
>> started at nothing and continues to devolve backwards.
>
> I was merely suggesting one possible way.
> I have never liked the idea of making two tables where one is sufficient.
>

You were suggesting a way which proves you have NO IDEA of what RELATION 
database design mean.

For instance, in YOUR design, what happens if he has no restaurants in 
the current classification?

> In the OP's example, we have going on exactly what you speak of.
> Let's say he wants to add on a second pet shop
> Now he has to change the id's in two tables.
> Plus, the remaining id's all have to be changed accordingly.
> So what if he has 1,000 rows?
> He made a change on row 5. So now the sequence of events has to change
> 1990+ items?
>

He needs to add the pet shop in one table and a relationship entity in a 
second table.  That's what RELATIONAL means.

> In my example, if you want to add on another pet store, all you do is
> insert the new row and increment the id's.
>
> Otherwise, he should have a table for each category.
> Forget cross referencing with id's.
>

This is beyond STOOPID!

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

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Loop through array, change headings Adrienne Boswell <arbpen@yahoo.com> - 2013-12-31 21:08 +0000
  Re: Loop through array, change headings Denis McMahon <denismfmcmahon@gmail.com> - 2013-12-31 21:22 +0000
    Re: Loop through array, change headings Adrienne Boswell <arbpen@yahoo.com> - 2013-12-31 23:40 +0000
  Re: Loop through array, change headings richard <noreply@example.com> - 2013-12-31 17:06 -0500
    Re: Loop through array, change headings Denis McMahon <denismfmcmahon@gmail.com> - 2013-12-31 23:00 +0000
      Re: Loop through array, change headings richard <noreply@example.com> - 2013-12-31 19:19 -0500
        Re: Loop through array, change headings Denis McMahon <denismfmcmahon@gmail.com> - 2014-01-01 00:39 +0000
        Re: Loop through array, change headings "Beauregard T. Shagnasty" <a.nony.mous@example.invalid> - 2014-01-01 00:56 +0000
        Re: Loop through array, change headings Jerry Stuckle <jstucklex@attglobal.net> - 2013-12-31 20:50 -0500
          Re: Loop through array, change headings richard <noreply@example.com> - 2013-12-31 21:08 -0500
            Re: Loop through array, change headings Jerry Stuckle <jstucklex@attglobal.net> - 2013-12-31 21:43 -0500
            Re: Loop through array, change headings "Beauregard T. Shagnasty" <a.nony.mous@example.invalid> - 2014-01-01 03:24 +0000
            Re: Loop through array, change headings Denis McMahon <denismfmcmahon@gmail.com> - 2014-01-01 03:26 +0000
        Re: Loop through array, change headings Arno Welzel <usenet@arnowelzel.de> - 2014-01-01 18:01 +0100
        Re: Loop through array, change headings Norman Peelman <npeelman@cfl.rr.com> - 2014-01-02 06:23 -0500
          Re: Loop through array, change headings Denis McMahon <denismfmcmahon@gmail.com> - 2014-01-02 13:09 +0000
            Re: Loop through array, change headings "Peter H. Coffin" <hellsop@ninehells.com> - 2014-01-02 09:20 -0600
              Re: Loop through array, change headings "Beauregard T. Shagnasty" <a.nony.mous@example.invalid> - 2014-01-02 15:39 +0000
                Re: Loop through array, change headings Jerry Stuckle <jstucklex@attglobal.net> - 2014-01-02 10:52 -0500
                Re: Loop through array, change headings "Beauregard T. Shagnasty" <a.nony.mous@example.invalid> - 2014-01-02 16:43 +0000
                Re: Loop through array, change headings "Peter H. Coffin" <hellsop@ninehells.com> - 2014-01-05 18:23 -0600
                Re: Loop through array, change headings "Peter H. Coffin" <hellsop@ninehells.com> - 2014-01-05 18:37 -0600
              Re: Loop through array, change headings Denis McMahon <denismfmcmahon@gmail.com> - 2014-01-02 18:04 +0000
    Re: Loop through array, change headings Arno Welzel <usenet@arnowelzel.de> - 2014-01-01 17:56 +0100

csiph-web