Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6824831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:56:55+00:00 2026-05-26T21:56:55+00:00

I have 2 database tables that looks like this Subscriptions table member_id active 5

  • 0

I have 2 database tables that looks like this

Subscriptions table

member_id    active
5            1 
7            0
8            1

Plans Table

member_id    disk
5            2000
7            5000
8            3000

Ii want to show disk for the currently logged in user where active = 1. So if currently logged in user is has member_id 8 and his active = 1 we will show 3000. We get the currently logged in user by doing $this->EE->session->userdata('member_id')

I have the following SELECT statement, but it’s not working. it’s throwing 500 internal server error. do you see anything wrong with it.

$results = $this->EE->db->query("SELECT disk FROM exp_membrr_plans p JOIN exp_membrr_subscriptions s ON p.member_id = s.member_id WHERE p.member_id = $this->EE->session->userdata('member_id') AND s.active=1 LIMIT 1");
$results->row('p.disk'); // the problem seems to be here. If i comment out this line i get no error
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T21:56:56+00:00Added an answer on May 26, 2026 at 9:56 pm

    Change it into something like this:

    $results = $this->EE->db->query("SELECT disk FROM exp_membrr_plans p JOIN exp_membrr_subscriptions s ON p.member_id = s.member_id WHERE p.member_id = " . $this->EE->session->userdata('member_id') . " AND s.active=1 LIMIT 1");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a database that contains a table that looks a bit like this:
I have a table in a MSSQL database that looks like this: Timestamp (datetime)
I have two tables in a database that looks like this members table1 id
I have some code to update a database table that looks like try {
so I have this problem. My Database has two tables that look something like
I am working with a legacy database schema that looks like this: product_table table
I have a script to delete all tables in my database that looks like
I have a database with two tables: Users , Items Users looks like this:
In my database I have tables that define types for example Table: Publication Types
I have a database two tables and a linking table that I need a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.