ChronoEngine.com homepage

Forums

Please write a review for the extension you are using on the Joomla extensions directory before posting a new question as we are being spammed by many negative reviews.

Thank you for your support!

check entry name - name duplicated

giusebos 15 Feb, 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
<?PHP
$db =& JFactory::getDBO();
$query = "
    SELECT COUNT(*)
        FROM `marcheAutomezzi`
        WHERE `marca` = '{$form->data['marca']}' ;
";
$db->setQuery($query);
$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 ..
This topic is locked and no more replies can be posted.

2Checkout.com

2CheckOut.com Inc. (Ohio, USA) is an authorized retailer for goods and services provided by ChronoEngine.com