FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Loop through array, change headings
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Loop through array, change headings [message #184450 is a reply to message #184438] Wed, 01 January 2014 17:01 Go to previous messageGo to previous message
Arno Welzel is currently offline  Arno Welzel
Messages: 317
Registered: October 2011
Karma:
Senior Member
Am 01.01.2014 01:19, schrieb richard:

> On Tue, 31 Dec 2013 23:00:32 +0000 (UTC), Denis McMahon wrote:
>
[...]
>> 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.

One table is NOT SUFFICIENT!

Because then EVERY classification has to be repeated over and over again
in every single record.

> In the OP's example, we have going on exactly what you speak of.

No we don't!

> Let's say he wants to add on a second pet shop
> Now he has to change the id's in two tables.

No! "Store" is a CATEGORY and "pet shop" is just an entry. One would
just create a record "Pet shop 2" with the CATEGORY "Store".

> Plus, the remaining id's all have to be changed accordingly.
> So what if he has 1,000 rows?

Even if the CATEGORY of existing entries would have to be changed - this
would be a simple SQL statement.

> He made a change on row 5. So now the sequence of events has to change
> 1990+ items?

No. You don't understand - as usual :-(



--
Arno Welzel
http://arnowelzel.de
http://de-rec-fahrrad.de
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: thank you, richard@noreply
Next Topic: PHP sql entry is a godaweful mess
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Sep 19 01:38:16 GMT 2024

Total time taken to generate the page: 0.05352 seconds