Skip to Content Skip to Menu

Requete SQL

  • sereniteam
  • sereniteam
  • OFFLINE
  • Posts: 244
  • Thanks: 16
  • Karma: 0
2 years 11 months ago #327013 by sereniteam
Requete SQL was created by sereniteam
What is the appropriate orthographe for using et requet field and get the number of lines in the rsform table such as :

SELECT COUNT(`SubmissionId`)
FROM `#__rsform_submission_values`
WHERE `FORMId`=45

Dont get any answer

SereniTeam

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

  • beat
  • beat
  • OFFLINE
  • Posts: 2169
  • Thanks: 463
  • Karma: 352
2 years 11 months ago #327017 by beat
Replied by beat on topic Requete SQL
We can't help on third-party components, sorry. Please ask the rsforms provider for help regarding his component and what query you need to get the result you want to use from rsforms.

Beat - Community Builder Team Member

Before posting on forums: Read FAQ thoroughly -- Help us spend more time coding by helping others in this forum, many thanks :)
CB links: Our membership - CBSubs - Templates - Hosting - Forge - Send me a Private Message (PM) only for private/confidential info

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

  • sereniteam
  • sereniteam
  • OFFLINE
  • Posts: 244
  • Thanks: 16
  • Karma: 0
2 years 11 months ago #327022 by sereniteam
Replied by sereniteam on topic Requete SQL
Can we put some "under-SELECT" in the query

such as SELECT COUNT`SubmissionId`
FROM `#__rsform_submissions`
WHERE `FORMId`=45 AND `UserId`=[user_id] AND (SELECT `SubmissionId` FROM `#__rsform_submission_values` WHERE `info_subid`=0)

SereniTeam

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

  • beat
  • beat
  • OFFLINE
  • Posts: 2169
  • Thanks: 463
  • Karma: 352
2 years 11 months ago #327025 by beat
Replied by beat on topic Requete SQL
SQL queries allow sub-queries, but again, we can't help on third-party components tables we don't know the structure nor content.

if you google for mysql subqueries you will find examples and tutorials and the MySQL manual page for the sub-queries syntax.

Beat - Community Builder Team Member

Before posting on forums: Read FAQ thoroughly -- Help us spend more time coding by helping others in this forum, many thanks :)
CB links: Our membership - CBSubs - Templates - Hosting - Forge - Send me a Private Message (PM) only for private/confidential info

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48424
  • Thanks: 8274
  • Karma: 1443
2 years 11 months ago #327085 by krileon
Replied by krileon on topic Requete SQL
I assume you're asking about CB Query Field and its Query Field for displaying the results of custom database queries on profile? It supports any valid SQL statement so yes you can output the count of a table. Otherwise you'll need to be more specific as to WHERE you're trying to use that query as several query usages have difference behavior (e.g. query conditions, userlist filtering, userlist sorting, etc..).


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 or Create an account to join the conversation.

  • sereniteam
  • sereniteam
  • OFFLINE
  • Posts: 244
  • Thanks: 16
  • Karma: 0
2 years 11 months ago #327095 by sereniteam
Replied by sereniteam on topic Requete SQL
Thank for your answer. Following your tutorials I get the following result.
Do you have any clue for that ?

Here is my query :
SELECT `lastname`,`cb_ville`,`cb_cp` FROM `#__comprofiler` WHERE `cb_titre`=2;

here is my presentation

Before :
<table>
<thead>
<tr>
<th scope="col" style="text-align:left; width: 70%;">Discipline</th>
<th scope="col" style="text-align:left; width: 20%;">Nature</th>
<th scope="col" style="text-align:center; width: 10%;">CP</th>
</tr>
</thead>
<tbody>

In the middle :

<tr>
<td style="text-align:left;">[column_lastname]</td>
<td style="text-align:left;">[column_cb_ville]</td>
<td style="text-align:center;">[column_cb_cp]</td>
</tr>

In the end </tbody>
</table>

SereniTeam
Attachments:

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

Moderators: beatnantkrileon
Powered by Kunena Forum