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 6369101
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:45:36+00:00 2026-05-25T00:45:36+00:00

Here are my two tables. I’m not sure they’re normalized correctly: all_configurator_lasers_power: laser_id |

  • 0

Here are my two tables. I’m not sure they’re normalized correctly:

all_configurator_lasers_power:

laser_id | power_id | laser_configuration
=========================================
    1       10         1
    1       25         1
    1       20         2
    1       50         2
    2       10         1 ...

all_configurator_power_text:

power_id | power_level | laser_configuration | power_text
========================================================= 
   10        10 watts        1                  10 watt text
   25        25 watts        1                  25 watt text
   20        20 watts        2                  20 watt text
   50        50 watts        2                  50 watt text

What I want back is the first two rows of the second table if I provide the laser_id in the first table.

This is what I tried (but didn’t work)

'SELECT * FROM all_configurator_power_text 
 INNER JOIN all_configurator_power_text 
 ON all_configurator_lasers_power.laser_configuration = all_configurator_power_text.laser_configuration'

This returns an array like this:

Array (
[0] => stdClass Object
        (
            [id] => 1
            [language] => en
            [power_id] => 10
            [power_level] => 10 watts
            [laser_configuration] => 1
            [power_text] => 10 watt text
            [laser_id] => 1
        )
...)

But the array (a CodeIgniter object) also returns objects with a laser_configuration of 2. I want just the ones with a 1. I added a WHERE clause of WHERE laser_configuration = 1 but then I get a non-object error.

What am I doing wrong?

  • 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-25T00:45:36+00:00Added an answer on May 25, 2026 at 12:45 am

    You need to specify which table’s laser_configuration you are using in your WHERE clause. Do that and it should work with the clause you wrote.

    So you’d end up with something like:

     SELECT * FROM all_configurator_power_text
     INNER JOIN all_configurator_lasers_power 
     ON all_configurator_lasers_power.laser_configuration = all_configurator_power_text.laser_configuration
     WHERE all_configurator_lasers_power.laser_configuration = 1
    

    Also, I recommend adding some shorthand references to make that more readable. It could play a big part in keeping yourself sane over the years:

     SELECT * FROM all_configurator_power_text text
     INNER JOIN all_configurator_lasers_power lasers
     ON lasers.laser_configuration = text.laser_configuration
     WHERE lasers.laser_configuration = 1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

here are my two tables of concern: CREATE TABLE IF NOT EXISTS `tutorial` (
Here is my select statement with the innerjoin of two tables, if not exists(select
here are my two tables CREATE TABLE IF NOT EXISTS `carslibrary` ( `CarID` int(10)
I have two tables and they are connected via the 'debt_key' here are the
There are two tables named Customers and Payments. They both have the CustomerNumber Here's
Alright so here are my two tables. CREATE TABLE [cards] ( [id] TEXT PRIMARY
First.. here are the two tables I've created (sans irrelevant columns).. CREATE TABLE users_history1
I have two tables as shown here . I am trying to fetch name
I have two tables: entitytype and project . Here are the create table statements:
I have two tables, images and image_data and here is an example of my

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.