You are here: Re: on input form showing error message for duplicate entry. « All PHP « IT news, forums, messages
Re: on input form showing error message for duplicate entry.

Posted by Steve on 10/18/06 14:12

| I am very grateful for you useful comments, suggestions and examples of
| code. Truly I am! I have downloaded and kept all suggestions in my
review
| codes folder. And will be spending the week end dissecting and working
out
| what does what, how and why. But please don't argue any more. I feel
| awful that I've been the cause of such discourse. The newsgroup seemed
| quite peaceful until I came along.

linda, i'm sorry this thread has become so muttled. i took offense at ikciu
calling you stupid. and the 'solution' he offered didn't even apply to your
question. he has yet to consider it fully. he does this in MOST of the
threads he responds to. i was tired of it, so i called him on his behavior
and lack of care in the posts he actually 'tries' to help with. again, sorry
it all came out here.


| a) The product code is the ID, this is beyond my control as the products
| come from the supplier with these codes on. Yes I realise I could have
set
| id to auto_increment, and then have another field for the product code,
but
| I thought that as certain products HAVE TO HAVE a unique code it would be
| just a waste having an id field with auto_increment. Besides which it
would
| be the product code that would be used for searching the data base, so i
| decided this would be set to primary and unique.

that is a great start, however without another unique id, there is no way to
tell that product 'abc' has been edited and the code changed to 'def'...when
'def' already existed. this means you will overwrite the original 'def'
record. the auto_increment id on the table IS needed, but far from a
stand-alone solution - as ikciu would have you believe.

| b) The reason for needing error reporting on duplicate entries is due to
the
| fact that I CAN'T have two or more product codes with the same id. But I
| also wanted the person inputting the data to realise that, the product
code
| they entered already existed, (a wake up and smell the coffee moment) so
go
| back and correct this!

that is the way i understood you as well. the sql statement in the example i
gave checks if PERSONEXISTS based on an auto_incremented id and the
userName. you'd simply be using the auto_incremented id and the productCode
for PRODUCTEXISTS and going from there.

| That's it pure and simple!


best of luck.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация