TOPIC:

Wert aus Variable auslesen 6 years 5 months ago #180905

  • Topic Author
  • tauchvati
  • Offline
  • New Member
  • New Member
  • Registered
  • Posts: 2
  • Thanks: 0
Hallo zusammen,
ich verwende BreezingForms erst seit kurzem und komme hier leider nicht weiter. Ich möchte über einen zugewiesenen Wert aus einer Formularvariabeln m_email eine SQL-Abfage auf eine Tabelle usv_mitglieder ausführen und mir einen anderen DB Eintrag zurückgeben lassen. Die SQL Abfrage funktioniert, auch der Wert von m_name wird zurückgegeben, jedoch bekomme ich immer eine Fehlermeldung s.u.

Es geht eigentlich lediglich um folgende Anweisung, siehe auch unten , 3letzte Anweisung:
$db->setQuery('Select mname From usv_mitglieder Where memail = 'm_email');

Hier das ganze Script...

$this->execPieceByName('ff_InitLib'); //Include BreezingForms Library
$db = JFactory::getDBO();//Get Database Object
$user = &JFactory::getUser();//Get user Object

//Create your own query
$db->setQuery('Select name From #__users Where id='.$user->id);
$result = $db->loadResult(); //load the result from the query
ff_setValue('m_nachname', $result); // populate the value in the form. Change ElementName to the real name of your element

$db->setQuery('Select email From #__users Where id='.$user->id);
$result = $db->loadResult(); //load the result from the query
$mail = $db->loadResult();
ff_setValue('m_email', $result); // populate the value in the form. Change ElementName to the real name of your element

$db->setQuery('Select mname From usv_mitglieder Where memail = 'm_email');
$result = $db->loadResult(); //load the result from the query
ff_setValue('m_name', $result);

Bekomme jedoch die Fehlermeldung. Weiß jemand Rat ?

Parse error: syntax error, unexpected 'm_email' (T_STRING) in /homepages/37/d244907543/htdocs/components/com_breezingforms/facileforms.process.php(1241) : eval()'d code on line 25

Please Log in or Create an account to join the conversation.

Wert aus Variable auslesen 6 years 5 months ago #180913

  • pedro81's Avatar
  • pedro81
  • Offline
  • Platinum Member
  • Platinum Member
  • Registered
  • Posts: 15269
  • Thanks: 1077
Hallo,

das ist was die Fehlanmeldung sagt, ein Syntax Fehler hier:
$db->setQuery('Select mname From usv_mitglieder Where memail = 'm_email');

versuch es bitte aber mit diesen Kode:
$db->setQuery('Select mname From usv_mitglieder Where memail = "m_email"');

Please Log in or Create an account to join the conversation.

Wert aus Variable auslesen 6 years 5 months ago #180952

  • Topic Author
  • tauchvati
  • Offline
  • New Member
  • New Member
  • Registered
  • Posts: 2
  • Thanks: 0
Danke für die schnelle Rückmeldung. Dies hatte ich auch bereits ausprobiert.

Die Fehlermeldung ist jetzt zwar weg, ich bekomme aber keinen Wert im Formular bei angezeigt.
m_email ist ja ebenfalls eine Variable deren Wert in der vorherigen Zeile per ff_setValue('m_email', $result) gezetzt wird, s. kompl. Script.

Ersetzte ich m_email mal im einer festen Emailadresse, die es in der DB gibt, so wir mir im Formular auch der dazugehörige Name angezeigt.

???

Please Log in or Create an account to join the conversation.

Wert aus Variable auslesen 6 years 5 months ago #181000

  • pedro81's Avatar
  • pedro81
  • Offline
  • Platinum Member
  • Platinum Member
  • Registered
  • Posts: 15269
  • Thanks: 1077
Hallo,

kannst du bitte ein Link zum Formular senden?

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.050 seconds

Support Chat

Join our Discord chat and enter the Crosstec channels for live-support, chat forums and interact directly with the community!

After joining, please enter the Crosstec Area and use the #crosstec-support or #crosstec-general channels.

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Subscribe to news and updates!

Special Offer

Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!

Live Support Chat Opened!

Join our Discord chat here and enter the Crosstec channels to receive live support and talk directly to the team!