1283 Posts
Bucklash
8 years ago
Topic

Hi folks

So I am experimenting with SQL pack plugin...

I have a art_alias field in a search form, I apply in the live column 'SQL Query'.

In the Live Value Column I enter my query:

SELECT alias FROM #__content WHERE id = 1

Great, it returns the correct value.

...

I check to see where this value is with in the variables by placing this code in a beforerender field:

print_r($fields);

I see that it is in 'value' and 'form'

Underneath I have a field

SELECT title FROM #__content WHERE state=1 AND alias = $cck->getValue('art_alias')

And I receive an error.

You have an error in your SQL syntax; 

check the manual that corresponds to your MySQL server version for the right syntax to use near 

'>getValue('art_alias')' 

at line 3 

SQL=SELECT title FROM #__content WHERE alias = $cck->getValue('art_alias')

This is just me experimenting but would appreciate any tips.

I have read this cool Klas Tut: sql-pack

Bucklash

Get a Book for SEBLOD
4229 Posts
Kadministrator
8 years ago
1
Level 1

As stated in the manual $cck->get does not work in live plugin. In fact it only works in "SQL as field" in content or list views.

1283 Posts
Bucklash
8 years ago
0
Level 2

Hi

Yep, missed the asterisk

Thanks

Get a Book for SEBLOD