my showtime table consists of following fields,

id, title, showtime where id is really a int type auto-increment area(pK). showtime time type unique area .

after i consider adding a showtime(duplicate value) to showtime area($row->store()) it shows the next joomla error message.(I made use of $row->getError() method)

    TableShowTime: :store failed
    Duplicate entry '10:30:00' for key 'showtime' SQL=INSERT INTO `jos_myextension_showtime` (`id`,`name`) VALUES ('0','evening')

I wish to know can there be in whatever way to exhibit just the db error message without showing sql query. I know to determine the duplicate values utilizing a query before place, could it be a sensible practice? Plz Help.

I believe when you won't want to display the query, then you definitely should not show another area of the error message neither (don't tell the consumer you are attempting to place a replica key). An easy fix to this can be something similar to this:

if ( $row>getError() ) {
   echo "Could not store [...]";
}

If this sounds like a custom component, you might modify your table class to personalize these error message, as well as show distinct error messages with respect to the error number.

I really hope it assisted!