You are here: Re: Insert duplicate row practice « PHP SQL « IT news, forums, messages
Re: Insert duplicate row practice

Posted by Du on 10/14/12 11:28

Thanks for your input Stefan!!!

> Do you mean you have a combined primary key (user_id, filename)?

Yeah that what I meant



"Stefan Rybacki" <stefan.rybacki@gmx.net> wrote in message
news:3qhktbFf0mufU1@individual.net...
> Du wrote:
>> I use mysql to monitor the download traffic from my website. I defined
>> user_id and the file name as the primary key.
>>
>
> Do you mean you have a combined primary key (user_id, filename)?
>
>
>> My question is, shoud I check if the item already existed in the database
>> before add or should I leave mysql handle duplicate primary key checking
>> ?
>>
>> Can you tell which method is more efficient?
>
> It depends. The result is the same, in case one you get the already
> existing entry in case two you get an error. I guess the first case is the
> better one, since you get the already existing entry and are able to use
> this for further processing instead.
>
> Regards
> Stefan
>
>>
>> Thanks ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure
>> Usenet News==----
>> http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+
>> Newsgroups
>> ----= East and West-Coast Server Farms - Total Privacy via Encryption
>> =----
>



----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----

 

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

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