|
Posted by Steve on 10/18/06 15:24
".:[ ikciu ]:." <no@mail.com> wrote in message
news:eh5egc$ooj$1@news.dialog.net.pl...
| Hmm Steve <no.one@example.com> wrote:
| >> try to understand...i'll explain one more time. i think you've missed
| > the following two points simply because you HAVEN'T listened to the
| > op or anyone else here. that, or you just don't understand the
| > english.
|
| i understand but primary key on varchar2 is for me not good solution, it
| should be ID
your feelings on the matter are very minor. the OP sets the rules. she
cannot control the product code/id. you can still create your primary key on
an auto-incrementing id...and you actually NEED to. and, even if you DO put
a unique contraint on the table, you certainly want to avoid throwing php
sql errors to the browser by not looking first to see if you're about to
violate the constraint! and THAT, in essence, was what she was asking in the
first place.
you're still not listening.
| > if i submit a new records for php to insert into a db, neither php
| > NOR the db have an id for the record. the record has NOT been created
|
| OFC
|
| > yet. auto-increment does not prevent us from submitting that same
| > data again and again, each time getting a new id for each record
| > being inserted. however, EVER submission after the FIRST is a
| > DUPLICATION.
|
| it will be inpossible if this field in db is unique or it is a primary
key -
| do you get it?
did you not read what i said when you finally suggested having a unique
field (product code) in addition to an auto-incrementing int id? i said that
after a full DAY of trying to explain that the auto-increment field would
solve all the problems, you suddenly came up with that suggestion...and that
you were starting to get on the right track. obviously I get it. i think
it's only NOW that you actually are starting to think the OP's question
through.
and no, it doesn't solve the OP's problem at all on the front-end. she wants
to know BEFORE she performs an insert, that she's about to violate the
contraint...she instead wants to warn the user that the product already
exists.
i'm not averse to saying you're right...you first need to be right, however.
so far, that idea only gets you on the right track. what i do think of as
ironic is the fact that my example, from the beggining, handles all of
this...yet you fail to see how AND say that it is wrong.
| > second, if i have an auto-incrementing field, it's use is to merely
| > be a record identifier. if i'm creating records with product
| > codes/id's or users with user names, each can be OVERWRITTEN without
| > effecting the record's id IN THE LEAST. if jblow is a user defined in
| > a users table and i change the user name of jrancher to jblow, i have
| > effectively overwritten the data of jblow. i have compromised both
| > the integrity of data AND potentially opened a wide security hole in
| > the system. auto-incrementing id's has done NOTHING to prevent it.
|
| omg ... you still think about autoincrement as a solution - this is only
| part of changes:
| 1 add numeric id as a PK
| 2. make unique on codeID
then describe THE FULL FUCKING SOLUTION THE FIRST TIME. you are the one who
said 'autoincrementing an id solves the problem'...would you like me to
quote you from your replies in this thread?
i find it interesting that, so late in the game, you apparently CHANGE what
your solution IS. especially after MULTIPLE explanations of the problem, the
correct solution, and opposition of what you orginally said many times.
makes me wonder...sounds like your story is really just changing outright
and, that you are leveraging our benefitting your language deficit as leway
to do so.
| > had you actually read or understood my code example, you'd have
| > quickly seen that BOTH of these issues were handled. you knit-picked
| > every part of that example (even though the 'problems' reloved around
| > your lack of understanding) yet missed that KEY FUNCTIONALITY. as you
| > say, 'for me, that won't do'.
|
| hehe
|
| > when you grow up, perhaps you'll learn to read something more
| > substancial than 'dick-and-jane' level code. if you think you are
| > STILL solving anything, then POST YOUR SOLUTION HERE.
|
| i posted it below linda post ealry
no, you posted half-baked english instructions that no one can understand. i
mean, post source code as i have done.
Navigation:
[Reply to this message]
|