Title: jonuk80's Replies | WordPress.org

---

# jonuk80

  [  ](https://wordpress.org/support/users/jonuk80/)

 *   [Profile](https://wordpress.org/support/users/jonuk80/)
 *   [Topics Started](https://wordpress.org/support/users/jonuk80/topics/)
 *   [Replies Created](https://wordpress.org/support/users/jonuk80/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/jonuk80/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/jonuk80/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/jonuk80/engagements/)
 *   [Favorites](https://wordpress.org/support/users/jonuk80/favorites/)

 Search replies:

## Forum Replies Created

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/users/jonuk80/replies/page/2/?output_format=md)
[→](https://wordpress.org/support/users/jonuk80/replies/page/2/?output_format=md)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Data Access – App Builder for Tables, Forms, Charts, Maps & Dashboards] Clickable rows](https://wordpress.org/support/topic/clickable-rows-2/)
 *  Thread Starter [jonuk80](https://wordpress.org/support/users/jonuk80/)
 * (@jonuk80)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/clickable-rows-2/#post-12548256)
 * That would be great. Thanks for your support again Peter
 * Best
 * Jon
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [SQL Table with clickable rows](https://wordpress.org/support/topic/sql-table-with-clickable-rows/)
 *  Thread Starter [jonuk80](https://wordpress.org/support/users/jonuk80/)
 * (@jonuk80)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/sql-table-with-clickable-rows/#post-12546560)
 * I will investigate with wpDataTable, and that’s okay – I fully understand!!
 * The reason I haven’t done that (although maybe I’m making a blindingly stupid
   mistake here), is that I don’t want to have to make an individual page for every
   single project.
 * I was just hoping to have one page that could fetch the data for every new project
   where necessary. i.e. so there’s a master page, then data is grabbed via SQL 
   to fill that page with information.
 * Please tell me I’ve missed something really obvious carike 🙂
    -  This reply was modified 6 years, 1 month ago by [jonuk80](https://wordpress.org/support/users/jonuk80/).
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [SQL Table with clickable rows](https://wordpress.org/support/topic/sql-table-with-clickable-rows/)
 *  Thread Starter [jonuk80](https://wordpress.org/support/users/jonuk80/)
 * (@jonuk80)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/sql-table-with-clickable-rows/#post-12546168)
 * Thanks carike. 🙂 Okay – I won’t use JS for validation/santiation.
 * My best find so far is wpDataTables, which I’ve purchased. But it doesn’t quite
   do what I need. However I wouldn’t know where to begin custom coding it.
 * The only alternative is I try to write my own php, but that is also far beyond
   the realms of my little brain!
 * Thing is, I know it’s possible…I just don’t know how!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Data Access – App Builder for Tables, Forms, Charts, Maps & Dashboards] Clickable rows](https://wordpress.org/support/topic/clickable-rows-2/)
 *  Thread Starter [jonuk80](https://wordpress.org/support/users/jonuk80/)
 * (@jonuk80)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/clickable-rows-2/#post-12546100)
 * Hi Peter,
 * So every row is a unique URL. But that URL would have to be automatic (I think)
   so when you click it, it can take you to a page with more detailed information
   based on the particular row that was clicked. Does that make any sense?
 * Thanks 🙂
 * Jon
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Data Access – App Builder for Tables, Forms, Charts, Maps & Dashboards] General Plugin Questions](https://wordpress.org/support/topic/general-plugin-questions-2/)
 *  Thread Starter [jonuk80](https://wordpress.org/support/users/jonuk80/)
 * (@jonuk80)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/general-plugin-questions-2/#post-12526985)
 * That’s great – thank you Peter! 🙂
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [Tables, Sessions & SQL](https://wordpress.org/support/topic/tables-sessions-sql/)
 *  Thread Starter [jonuk80](https://wordpress.org/support/users/jonuk80/)
 * (@jonuk80)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/tables-sessions-sql/#post-12514307)
 * For anyone who’s interested, you don’t need the $wdbp prefix on custom tables
   in a query. Amending the code to below fixes it.
 * > <?php
   >  $current_user = wp_get_current_user(); $projectref = $wpdb->get_var(“
   > SELECT pr_no FROM projects WHERE ID=$current_user->ID”); echo “{$projectref}”;
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [Tables, Sessions & SQL](https://wordpress.org/support/topic/tables-sessions-sql/)
 *  Thread Starter [jonuk80](https://wordpress.org/support/users/jonuk80/)
 * (@jonuk80)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/tables-sessions-sql/#post-12514198)
 * No problem Steve – not trying to offend here, I’m just trying to learn.
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [Tables, Sessions & SQL](https://wordpress.org/support/topic/tables-sessions-sql/)
 *  Thread Starter [jonuk80](https://wordpress.org/support/users/jonuk80/)
 * (@jonuk80)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/tables-sessions-sql/#post-12514177)
 * Thank you, that worked. I changed it to
 *     ```
       <?php
       $current_user = wp_get_current_user();
       $username = $wpdb->get_var( "SELECT display_name FROM $wpdb->users WHERE ID=$current_user->ID" );
       echo "{$username}";
       ```
   
 * Please can you shed some light on questions 2 & 3 above?
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [Tables, Sessions & SQL](https://wordpress.org/support/topic/tables-sessions-sql/)
 *  Thread Starter [jonuk80](https://wordpress.org/support/users/jonuk80/)
 * (@jonuk80)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/tables-sessions-sql/#post-12514119)
 * I think I’m getting closer to what I want. Using php snippets, I am able to insert
   the $wpdb->get_var command and pull single instances from the WP database, which
   works.
 * Maybe someone can help with the following questions.
 * 1. On a page I have the following snippet
 *     ```
       <?php
       $username = $wpdb->get_var( "SELECT display_name FROM $wpdb->users WHERE ID=2" );
       echo "{$username}";
       ```
   
 * This currently echos the display name from whoever user ID 2 is. How do I amend
   this statement so it shows the name of whoever’s logged in?
 * 2. Going one step futher, I have created some custom tables i.e. wp_projects.
   For this one, I made this query.
 *     ```
       <?php
       $projectref = $wpdb->get_var( "SELECT pr_no FROM $wpdb->projects WHERE user_id=1" );
       echo "{$projectref}";
       ```
   
 * However, it echos nothing, and comes up blank. Does the wpdb shortcode not work
   with custom tables?
 * 3. If you can solve the above, can I go one step further with that code. You 
   can see it’s just WHERE user_id=1, but I’d like it to display only the project
   number(s) relevant to the person logged in.
 * There is a FK in ‘projects’ user_id, which links to ‘wp_users’ ID.
 * Many thanks!
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [Tables, Sessions & SQL](https://wordpress.org/support/topic/tables-sessions-sql/)
 *  Thread Starter [jonuk80](https://wordpress.org/support/users/jonuk80/)
 * (@jonuk80)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/tables-sessions-sql/#post-12513880)
 * Thanks Steve. That looks like quite a bit of coding know how.
 * I can’t believe it’s so hard to query single fields at a time and stick them 
   on a page. Maybe I’m just being naive in thinking I can do it!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Data Access – App Builder for Tables, Forms, Charts, Maps & Dashboards] General Plugin Questions](https://wordpress.org/support/topic/general-plugin-questions-2/)
 *  Thread Starter [jonuk80](https://wordpress.org/support/users/jonuk80/)
 * (@jonuk80)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/general-plugin-questions-2/#post-12509603)
 * Thanks for the ETA peter 😉
 * I think I understand it, although I’m likely to need multiple project -> one 
   login. Or maybe two logins -) multiple projects. Say a husband and wife wanted
   their own login but to access the same sets of data…
 * I will see what I can do with your fantastic tool for now however!! 🙂
 * Thanks!!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Data Access – App Builder for Tables, Forms, Charts, Maps & Dashboards] General Plugin Questions](https://wordpress.org/support/topic/general-plugin-questions-2/)
 *  Thread Starter [jonuk80](https://wordpress.org/support/users/jonuk80/)
 * (@jonuk80)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/general-plugin-questions-2/#post-12506925)
 * Hi Peter,
 * Not a stupid question at all, sorry I shouldn’t use acronyms! ETA = Estimated
   Time of Arrival. In other words, do you know when you might have this functionality
   implemented?
 * As for your other question, let me try and explain.
 * I want to use the ‘client portal’ as a tracking facility. In my work, for each
   client, I have to track a large number of things and would like to do it via 
   a web interface.
 * Here’s a reduced example of the structure:
    -  **Tables**
 * wp-users (my clients will go in here)
    user-data (their addresses, telephone 
   numbers etc) projects (a list of all current projects, with status, project number
   etc) project-constraints (a list of project constraints, like flooding, fire 
   etc).
    -  **Queries**
 * This is where I get stuck! So on one page, I want to be able to, based on the
   user alone, query the database so it extracts information from ‘projects’ and‘
   project-constraints’. In reality it’s about 7 tables. I figure if I can do it
   with 2, I can work out how to do the remaining 5.
 * So one page may say
 * Good morning $$user$$
    Your current projects are (queried from ‘projects’) $$
   project_name$$, $$project_status$$, $$project_link$$
 * Most of the time it will be only one, but it could be more. They can then click
   on that project to a details page.
 * In that page it might say
 * $$project-name$$, $$project-ref$$
 * The current constraints are as follows
 * Flooding: $$project-constraints-flooding$$ (which will just be a yes, no or TBC)
   
   Fire: $$project-constraints-fire$$ Notes: $$project-notes$$
 * etc etc.
 * Does that make sense? 🙂
 * Kind regards
 * Jon
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [Tables, Sessions & SQL](https://wordpress.org/support/topic/tables-sessions-sql/)
 *  Thread Starter [jonuk80](https://wordpress.org/support/users/jonuk80/)
 * (@jonuk80)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/tables-sessions-sql/#post-12504095)
 * Okay looks like I need to do some WPDB learning :/ I wonder if there are any 
   plugins that can help.
 * Naivety? I don’t really understand what I’m doing with WP and I’m trying to make
   a custom client portal. I’ve looked into plugins but none of them seem to do 
   what I want. What are custom post types?
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [Tables, Sessions & SQL](https://wordpress.org/support/topic/tables-sessions-sql/)
 *  Thread Starter [jonuk80](https://wordpress.org/support/users/jonuk80/)
 * (@jonuk80)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/tables-sessions-sql/#post-12503725)
 * Thanks, I’ll look into shortcode.
 * With my tables then, I’m guessing I will have to create a FK in projects, which
   links to the UserID (the default PK in WP)? I’m a bit stuck on how to do this.
   I know how to link the two in SQL, but I’m not sure how I link a query to the
   shortcode above!
 * Thanks again!
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [Tables, Sessions & SQL](https://wordpress.org/support/topic/tables-sessions-sql/)
 *  Thread Starter [jonuk80](https://wordpress.org/support/users/jonuk80/)
 * (@jonuk80)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/tables-sessions-sql/#post-12503586)
 * Thanks Steve,
 * Can anyone shed any light on how I might achieve the above? Specifically question
   3?
 * Cheers

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/users/jonuk80/replies/page/2/?output_format=md)
[→](https://wordpress.org/support/users/jonuk80/replies/page/2/?output_format=md)