Re: [PHP-WIN] notify user of duplicate entry

2001-06-28 Thread Pete Kuczynski
Thanks Andrian, Paul DuBois suggested the same thing you did. The column that concerns me is already UNIQUE, so all I need to do is something like this, after the insert statment in PHP like you suggest: // check if row is returned, if yes error, if no insert if (mysql_affected_row

RE: [PHP-WIN] notify user of duplicate entry

2001-06-28 Thread Michael Rudel
Hi Pete, spontaneously I can give you two different ways/suggestions: 1.) Get the value 'mysql_query' returns. If it's _not_ true, call 'mysql_errno'. If it returns (1062) this means you have a dupplicate entry. --> Inform the user. 2.) make a 'SELECT COUNT(*) as num_entries FROM as