Buy Now
Sign in

check entry name - name duplicated

giusebos , February 15 2016
I would check that your entry is not already in the database
My Forms:
in design
textbox (field name e field ID = marca)
submit button

in setup
On load
HTML (render Form)

On Submit
event switcher
DB save
Display message

code php in event switcher

$db =& JFactory::getDBO();
$query = "
FROM `marcheAutomezzi`
WHERE `marca` = '{$form->data['marca']}' ;
$count = $db->loadResult();
if ( $count ) {
$form->validation_errors['marca'] = "nome prersente.";
return false;

my table 2 field:
idmarca, marca

I can not do any checking of the name ..