TOPIC:

SELECT statement in word wrap item creates notice 1 year 2 months ago #244628

  • Topic Author
  • relsig
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 23
  • Thanks: 0
Hello

I use the following php expression in a view of Content builder.
<?php $db =& JFactory::getDBO();
$sql = "SELECT Kurzform FROM #__osvvereine WHERE EDV =$value";
$db->setQuery($sql);
$value = $db->loadResult(); ?>

This works fine an replaces a number (EDV) in my list view through Kurzform, which is a text.

Unfortunately there are lots of notices in the backend, which it seems I can't get rid off.
Notice: Only variables should be assigned by reference in (... removed)/administrator/components/com_contentbuilder/classes/contentbuilder.php(564) : eval()'d code on line 1 

I know that there are "$value", that don't have a "Kurzform" anymore. EDIT: Just fixed that problem, but there are still the same notices.

Can I get rid of that somehow?

Thanks

Roger

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

Last edit: Post by relsig.

SELECT statement in word wrap item creates notice 1 year 2 months ago #244642

  • TheMuffinMan's Avatar
  • TheMuffinMan
  • Offline
  • Developer
  • Developer
  • Posts: 10064
  • Karma: 167
  • Thanks: 808
Hi,

please use this instead
<?php $db = JFactory::getDBO();
$sql = "SELECT Kurzform FROM #__osvvereine WHERE EDV = " . $db->quote($value);
$db->setQuery($sql);
$value = $db->loadResult(); ?>

Also please always quote what you hand over to database queries to prevent security issues.

Regards,
Markus
The following user(s) said Thank You: relsig

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

SELECT statement in word wrap item creates notice 1 year 2 months ago #244658

  • Topic Author
  • relsig
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 23
  • Thanks: 0
Hi Markus

Thank you very much.

I got the code from here

Shouldn't it be adjusted then?

Roger

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

Last edit: Post by relsig.

SELECT statement in word wrap item creates notice 1 year 2 months ago #244670

  • TheMuffinMan's Avatar
  • TheMuffinMan
  • Offline
  • Developer
  • Developer
  • Posts: 10064
  • Karma: 167
  • Thanks: 808
Good point, I will adjust that!

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

  • Page:
  • 1
Moderators: ForumSupport
Time to create page: 0.041 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

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

Special Offer

Summer 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!