Welcome, Guest
  • Page:
  • 1

TOPIC: Select record: why not working ???

Select record: why not working ??? 1 year, 9 months ago #16173

Hello
I need to select and count some records in one table. But for any reason, it odes not work. I check in different documents and post but I don't see my error.
Anyone to help me please?
function ff_verify_database (element, action)
{
   var value_name=ff_getElementByName('name').value;
   var value_surname=ff_getElementByName('surname').value;

   $row = ff_select("SELECT * FROM #__annuaire WHERE name=value_name AND surname=value_surname");

   if (count($row)!=0)
   {
      if (message=='') message = "You are already in the database.\n";
      ff_validationFocus(element.name);
      return message;
   }
}

Thank you in advance
  • frlobe
Last Edit: 1 year, 9 months ago by .

Re: Select record: why not working ??? 1 year, 9 months ago #16321

Hi! Seems like your SELECT statement is amiss. The literal string "value_name" and "value_surname" gets plugged into the statement, not the values they contain. Try this instead:

$row = ff_select("SELECT * FROM #__annuaire WHERE name='" + value_name + "' AND  surname='" + value_surname + "'");


You might also want to convert the values to uppercase before comparison.

HTH!
  • havoc
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
  • Karma: 0

Re: Select record: why not working ??? 1 year, 9 months ago #16322

Hi! Seems like your SELECT statement is amiss. The literal string "value_name" and "value_surname" gets plugged into the statement, not the values they contain. Try this instead:

$row = ff_select("SELECT * FROM #__annuaire WHERE name='" + value_name + "' AND  surname='" + value_surname + "'");


You might also want to convert the values to uppercase before comparison.

HTH!
  • havoc
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
  • Karma: 0

Re: Select record: why not working ??? 1 year, 9 months ago #16344

Hello
thank you for your answer.
I change the SELECT as you mention. But I receive an error:
Erreur : ff_select is not defined
Fichier Source : http://localhost/assoc/index.php?option=com_breezingforms&Itemid=29
Ligne : 974

What is strange is that I active ff_IniLib in my form, I copy the line in this script to activate ff_select
    $this->execPieceByName('ff_InitUtilities');
    $this->execPieceByName('ff_SubmitUtilities');
    if (!function_exists('ff_select')) $this->execPieceByName('ff_select');

I don't undestand why ff_select is not defined.

As per the uppercase, it is already included in my field with this:
function ff_field_action(element, action)
{
   ff_getElementByName('field').value = ff_getElementByName('field').value.toUpperCase();
} //ff_field_action

as both records and fields ar in the same format. And it works
Thank you
  • frlobe
  • Page:
  • 1
Moderators: TheMuffinMan, ForumSupport
Time to create page: 0.33 seconds

Facebook Discount - 40% Off!

Fans of our Facebook page here are entitled to get a 1-year-subscription for the price of a 6-months!

Steps to take:

  • Become a fan on Facebook (Like) here
  • Purchase a 6-months-subscription from here
  • Write a quick email to This email address is being protected from spambots. You need JavaScript enabled to view it. with your username and prove of your like and we'll upgrade to the 1-year-subscription

Joomla!® Forms Discount - 40% Off!

Already purchased a forms extension from a different vendor but your requirements changed and now you need a forms extension that is capable of more than just the standards? We help you to keep the costs for a change under control: Get a 40% discount on our professional membership plan! -- meaning timely unlimited access to all current and future commercial extensions, breezingforms themes & apps and Joomla!® templates at crosstec.de, including 1 year of support -- without any website limitations -- Just prove that you previously purchased another forms extension for Joomla!® from a different vendor and you are qualified.

Steps to take:

  • Purchase a 1-year-subscription from here
  • Write a quick email to This email address is being protected from spambots. You need JavaScript enabled to view it. with your username and prove of the purchase for the other form vendor and we'll upgrade to the professional-subscription

About

Crosstec GmbH & Co. KG

Bergisch-Gladbacher-Str. 829

51069 Cologne, Germany

Imprint