i have a itemCode field which is the primary key but is entered by the user. how do i check if the item code already exist to prevent error entry of the same itemCode?
@HuevoosJun 07.2007 — #neither MySql nor Postgress allow a duplicate primary key, so you should just check the affected rows http://www.php.net/manual/en/function.mysql-affected-rows.php after the insert, or you could do a simple "select itemCode from table where itemCode = $itemCode" before the insert or you could make a trigger, but that's more mysql related.