Hi All I have around 5 different tables containing employee records (Name, skill set , current company, years of experience etc). I am trying to show the employee records for different kind of search.
One seacrh may be, show all the employees having knowledge on PHP and must have 5+ years of experience. I know, I need to a database query and show it in a view (either a page or block display).
I know how to collect the records. The query will be something like this.
SELECT res_table.name, res_table.yrsexp, res_table.emailid FROM res_table WHERE (res_table.yrsexp >= 5 AND skilltable.userid = $user->userid AND skilltable.skill = 'PHP') Or even in some cases I need to go for JOIN.
Somebody suggested to use Data module for it. I gave a try, I am just seeing tables (in view creation), not sure how do I impose the custom SQL query. Is it really possible to impose above kind of sql query using Data module???
Or is it the best way to go for custom module and implement _alter_view or _pre_exute_view hooks.
Regards Austin
Assuming that "res_table" is the primary table you created for the view, then "skilltable" would be a Relationship that you would define in that section of the view.
All the fields in the WHERE clause are "filters," which you would "expose" to the user. Nancy Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.
________________________________ From: Austin Einter austin.einter@gmail.com To: support@drupal.org; development@drupal.org Sent: Fri, April 8, 2011 10:27:32 PM Subject: [support] Doubts on VIEWS & DATA module - please help me
Hi All I have around 5 different tables containing employee records (Name, skill set , current company, years of experience etc). I am trying to show the employee records for different kind of search.
One seacrh may be, show all the employees having knowledge on PHP and must have 5+ years of experience. I know, I need to a database query and show it in a view (either a page or block display).
I know how to collect the records. The query will be something like this.
SELECT res_table.name, res_table.yrsexp, res_table.emailid FROM res_table WHERE (res_table.yrsexp >= 5 AND skilltable.userid = $user->userid AND skilltable.skill = 'PHP')
Or even in some cases I need to go for JOIN.
Somebody suggested to use Data module for it. I gave a try, I am just seeing tables (in view creation), not sure how do I impose the custom SQL query. Is it really possible to impose above kind of sql query using Data module???
Or is it the best way to go for custom module and implement _alter_view or _pre_exute_view hooks.
Regards Austin
Thanks Nancy.
I am very much confused what to do at this stage. My requirements are -
1. There will be a small search form, where user need to put the data (on that "data" basis search should be done).
2. There will be a search button in the form, on pressing search button the form data should be taken as input, a SQL query should be exucted, and records returned from SQL query should be shown in a tabular formt. Here the SQL query may involve 3/4 tables with JOIN and WHERE operations.
3. One coulmn in table (say name field) should be clickable. On clicking that field details about the user should be shown.
This is what my precise requirement.
Can somebody suggest, is it possible to acheive abobe thing using VIEW module or it will be better to have a custom module?
Please bear with me these questions, if I asking bit silly questions.
Best Regards Austin
On Sat, Apr 9, 2011 at 8:12 AM, nan wich nan_wich@bellsouth.net wrote:
Assuming that "res_table" is the primary table you created for the view, then "skilltable" would be a Relationship that you would define in that section of the view.
All the fields in the WHERE clause are "filters," which you would "expose" to the user.
*Nancy*
Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.
*From:* Austin Einter austin.einter@gmail.com *To:* support@drupal.org; development@drupal.org *Sent:* Fri, April 8, 2011 10:27:32 PM *Subject:* [support] Doubts on VIEWS & DATA module - please help me
Hi All I have around 5 different tables containing employee records (Name, skill set , current company, years of experience etc). I am trying to show the employee records for different kind of search.
One seacrh may be, show all the employees having knowledge on PHP and must have 5+ years of experience. I know, I need to a database query and show it in a view (either a page or block display).
I know how to collect the records. The query will be something like this.
SELECT res_table.name, res_table.yrsexp, res_table.emailid FROM res_table WHERE (res_table.yrsexp >= 5 AND skilltable.userid = $user->userid AND skilltable.skill = 'PHP') Or even in some cases I need to go for JOIN.
Somebody suggested to use Data module for it. I gave a try, I am just seeing tables (in view creation), not sure how do I impose the custom SQL query. Is it really possible to impose above kind of sql query using Data module???
Or is it the best way to go for custom module and implement _alter_view or _pre_exute_view hooks.
Regards Austin
-- [ Drupal support list | http://lists.drupal.org/ ]
Hi All I just used below code to show the required result.
function resume_search_skill_based_search() { $header = array('Name', 'Email', 'Phone', 'Experience(Years)'); $data = array(); $query = db_query("SELECT name, email, phone, yrsofexp FROM {resubmt_table}"); while ($row = db_fetch_array($query)) $data[] = $row; $output = theme('table', $header, $data); return $output; }
Though this query is simple I can replace with actual query. With this probably I will not use view.
Now, I want to make one coulmn in table should be a link, for example name field should be a link , on clicking it I should be able to prepare the data on fly and show it user. Is it really possible? If so, please give me some hink.
Regards, Austin
On Sat, Apr 9, 2011 at 11:34 AM, Austin Einter austin.einter@gmail.comwrote:
Thanks Nancy.
I am very much confused what to do at this stage. My requirements are -
- There will be a small search form, where user need to put the data (on
that "data" basis search should be done).
- There will be a search button in the form, on pressing search button the
form data should be taken as input, a SQL query should be exucted, and records returned from SQL query should be shown in a tabular formt. Here the SQL query may involve 3/4 tables with JOIN and WHERE operations.
- One coulmn in table (say name field) should be clickable. On clicking
that field details about the user should be shown.
This is what my precise requirement.
Can somebody suggest, is it possible to acheive abobe thing using VIEW module or it will be better to have a custom module?
Please bear with me these questions, if I asking bit silly questions.
Best Regards Austin
On Sat, Apr 9, 2011 at 8:12 AM, nan wich nan_wich@bellsouth.net wrote:
Assuming that "res_table" is the primary table you created for the view, then "skilltable" would be a Relationship that you would define in that section of the view.
All the fields in the WHERE clause are "filters," which you would "expose" to the user.
*Nancy*
Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.
*From:* Austin Einter austin.einter@gmail.com *To:* support@drupal.org; development@drupal.org *Sent:* Fri, April 8, 2011 10:27:32 PM *Subject:* [support] Doubts on VIEWS & DATA module - please help me
Hi All I have around 5 different tables containing employee records (Name, skill set , current company, years of experience etc). I am trying to show the employee records for different kind of search.
One seacrh may be, show all the employees having knowledge on PHP and must have 5+ years of experience. I know, I need to a database query and show it in a view (either a page or block display).
I know how to collect the records. The query will be something like this.
SELECT res_table.name, res_table.yrsexp, res_table.emailid FROM res_table WHERE (res_table.yrsexp >= 5 AND skilltable.userid = $user->userid AND skilltable.skill = 'PHP') Or even in some cases I need to go for JOIN.
Somebody suggested to use Data module for it. I gave a try, I am just seeing tables (in view creation), not sure how do I impose the custom SQL query. Is it really possible to impose above kind of sql query using Data module???
Or is it the best way to go for custom module and implement _alter_view or _pre_exute_view hooks.
Regards Austin
-- [ Drupal support list | http://lists.drupal.org/ ]