[#5864] Query Field

8 years 4 weeks ago - 8 years 4 weeks ago #279416 by edmundcheong
[#5864] Query Field was created by edmundcheong
I have tried doing something like the attached image. Works on phpmyadmin but not in the query field environment..

Have set the table to display as multiple rows by using the [column_columnname] but still not showing..

Am i doing something wrong?
Attachments:

Please Log in to join the conversation.

8 years 4 weeks ago #279429 by krileon
Replied by krileon on topic Query Field
Enable debug mode and maximum error reporting in Joomla global configuration then test if the query is failing. The columns available to that query should be as follows.

[column_rank]
[column_itemID]
[column_ordercount]

We can't really help you with debugging custom queries on non-CB and non-Joomla tables as we've no mean of testing and confirming your query (we are not going to setup custom tables to match your environment, sorry). The below for example works fine.

Query:
SELECT `username` FROM `#__users`
Output: Multiple Rows
Row:
<div>[column_username]</div>


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

8 years 4 weeks ago #279476 by edmundcheong
Replied by edmundcheong on topic Query Field

krileon wrote:
We can't really help you with debugging custom queries on non-CB and non-Joomla tables as we've no mean of testing and confirming your query (we are not going to setup custom tables to match your environment, sorry). The below for example works fine.


Dear Kyle.. dont worry about it.. ;)

Am just checking about having the "set" function in Query Field..

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 SELECT @bil:=@bil +1 as bil, cb_firstfield..

FYI, I would like to display a first column with numbers generated, for example 1, 2, 3.. to display the table row..
SET @bil=0;
SELECT @bil:=@bil +1 as bil, cb_companyname as companyname, cb_address01 as add01, cb_address02 as add02, cb_postcode as pcode, cb_city as city, cb_state as state, cb_record as record 

FROM `myprefix_comprofiler`

WHERE cb_companyname='[cb_companyname]' AND cb_record='Active'

ORDER BY cb_companyname ASC

I believe the field query is unable to do this:
SET @bil=0;
SELECT @bil:=@bil +1 as bil

Do you think so?

Please Log in to join the conversation.

8 years 4 weeks ago #279496 by krileon
Replied by krileon on topic Query Field
I've no idea if SET usage will work in Joomla SQL API. Never tried. Based off your tests I would assume it does not. Will add a feature ticket to support a substitution for the row count this way you wouldn't need to do anything like that to get a rows count.

forge.joomlapolis.com/issues/5864

Also note latest release supports templates now (on a field by field basis) which sends the raw query results to the template file where you could do custom PHP parsing of your query results if desired.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.178 seconds

Facebook Twitter LinkedIn