[SOLVED] Query Field for Displaying Link

8 years 6 months ago #272665 by tjohns92109
Replied by tjohns92109 on topic Query Field for Displaying Link
Additionally, attached is a screenshot of the exact same query (pasted) in phpMyAdmin... (query1.png)
And a screenshot of the query in CB query parameters (query2.png)

Just to reiterate... I AM NOT trying to do a query validation... just using the query field to display a list of results from the DB. Please don't send more instructions on validation... this only concerns the query field type.
Attachments:

Please Log in to join the conversation.

8 years 6 months ago #272681 by nant
Replied by nant on topic Query Field for Displaying Link

tjohns92109 wrote: Additionally, attached is a screenshot of the exact same query (pasted) in phpMyAdmin... (query1.png)
And a screenshot of the query in CB query parameters (query2.png)

Just to reiterate... I AM NOT trying to do a query validation... just using the query field to display a list of results from the DB. Please don't send more instructions on validation... this only concerns the query field type.


Question: is the table in the same database as Joomla?
The following user(s) said Thank You: tjohns92109

Please Log in to join the conversation.

8 years 6 months ago #272697 by tjohns92109
Replied by tjohns92109 on topic Query Field for Displaying Link
Yes. Same database.

Please Log in to join the conversation.

8 years 6 months ago - 8 years 6 months ago #272702 by krileon
Replied by krileon on topic Query Field for Displaying Link
You're selecting multiple rows without setting it to multiple row output. Try the below usage to limit it to a single row.

SELECT `cf_pdf_file` FROM `2sc_form8130` WHERE `user_id` = '[user_id]' LIMIT 1

To output multiple rows you'd need to use the following usage.

Query:
SELECT `cf_pdf_file` FROM `2sc_form8130` WHERE `user_id` = '[user_id]'
Output: Multiple Rows
Row:
<div>[column_cf_pdf_file]</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.
The following user(s) said Thank You: tjohns92109

Please Log in to join the conversation.

8 years 6 months ago #272709 by tjohns92109
Replied by tjohns92109 on topic Query Field for Displaying Link
Strange... I copied your query into the query parameter. It worked to return a single row. I compared it character by character to the one that didn't work and don't see the slightest difference (even checked the backticks and single quotes). Maybe a caching issue or there was a hidden character that I copied before.

Anyway, thanks for repeating that query because it does seem to work now.

You are correct in thinking I want to return more than 1 row. I put the div in the row field and it works!!! I was losing faith haha.

Quick additional question... that query returns rows that have the user_id of the profile that the field is on. Is there a way to echo rows from the user that's logged in? Do I need to get and declare that variable (as in $user = JFactory::getUser())? Or is it already available?

Please Log in to join the conversation.

8 years 6 months ago #272734 by krileon
Replied by krileon on topic Query Field for Displaying Link

Quick additional question... that query returns rows that have the user_id of the profile that the field is on. Is there a way to echo rows from the user that's logged in? Do I need to get and declare that variable (as in $user = JFactory::getUser())? Or is it already available?

It supports standard substitutions too. So if you want to substitute in their username for example you could do [username]. See the below for substitution usage information.

www.joomlapolis.com/support/tutorials/107-use-cases/18353-using-substitutions-throughout-cb


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.234 seconds

Facebook Twitter LinkedIn