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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:27:21+00:00 2026-05-25T13:27:21+00:00

SELECT * FROM `enzymes` INNER JOIN `compounds` ON compounds.compound_id = enzymes.compound_id WHERE `ec` LIKE

  • 0
SELECT       *
FROM         `enzymes`
  INNER JOIN `compounds`
  ON         compounds.compound_id = enzymes.compound_id
WHERE        `ec` LIKE '1.11%'

it works in phpmyadmin and mysql workbench.

It won’t work regardless whether I backtick everything use mysql_real_escape_string and add the database name where appropriate. the phpmyadmin php code won’t work either.

ERRORS: Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in….

same error for all other query-resource dependent functions

Upd:

case 'ec':
    $dbl = mysql_connect(DB_ADDRESS, DB_USER, DB_PASSWORD);
    mysql_select_db("kegg", $dbl);
    //a)connection is fine
    //b)tried with explicitly providing the db name vs with pre-selection
    $sql = "SELECT * FROM enzymes INNER JOIN `compounds` ON compounds.compound_id=enzymes.compound_id";
    print_r($sql);
    $result = mysql_query( $sql, $dbl);
    print  mysql_error ($dbl);
    while ($row = mysql_fetch_assoc($result)) {
         print_r($row)
         $items[ $row['name'] ] = $row['compound_id'];          
    }

,,,

Solution: Thanks everyone,- Brad gave the crucial answer first.

$sql = "SELECT enzymes.*, compounds.*\n"
. "FROM enzymes\n"
. " INNER JOIN compounds\n"
. " ON compounds.compound_id = enzymes.compound_id\n"
. "WHERE enzymes.ec LIKE '1.11%' LIMIT 0, 30 ";

A similar topic came up recently where it was suggested that it only works when selecting specific fields. The crucial solution when all data is desired is to resolve ambiguities to:

enzymes.*, compounds.*
  • 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-25T13:27:21+00:00Added an answer on May 25, 2026 at 1:27 pm

    My gut is telling me the database is confused by your column references. When you start doing joins, and especially when you have columns names that may match, it’s good practice to be explicit on what you’re selecting, comparing, etc. e.g.

    SELECT       enzymes.*
    FROM         enzymes
      INNER JOIN compounds
      ON         compounds.compound_id = enzymes.compound_id
    WHERE        counpounds.ec LIKE '1.11%'
    

    But, without knowing the exact error that’s occurring, this can only be a guess.

    UPDATE

    Now that I see the error, make sure you’re testing for a proper query response. When you call mysql_query (or whatever you use), check the resource for failure before trying to fetch the result. Most connection libraries have a *_error or *_last_error method you can call to see what caused the failure.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

SELECT * FROM ExternalQuestionKeyword INNER JOIN ExternalKeywords ON ExternalKeywords.ID=ExternalQuestionKeyword.KeywordID WHERE QuestionID = 17
SELECT * FROM [Group] g INNER JOIN User2Group ug **on g.Id != ug.GroupId** INNER
Example: select * from component inner join component_supplier on component.id = component_supplier.component_id inner join
SELECT * FROM Table_A LEFT JOIN Table_B ON (Table_A.A_ID = Table_B.A_ID) INNER JOIN Table_C
SELECT * FROM conference_attende_options INNER JOIN conference_options ON conference_attende_options.option_id = conference_options.option_id WHERE conference_attende_options.PersonID =
SELECT * FROM tableA a INNER JOIN tableB b ON a.someColumn = b.otherColumn INNER
SELECT * FROM Questions INNER JOIN QuestionKeyword INNER JOIN Keywords ON Questions.ID=QuestionKeyword.QuestionID AND QuestionKeyword.KeywordID=Keywords.ID
SELECT p.id FROM produkty p, przyporzadkowania pr, stany_magazynowe, gk_grupy_produkty INNER JOIN sub_subkategorie ssi ON
SELECT * FROM myTable WHERE field1 LIKE 'match0' AND myfunc(t1.hardwareConfig) LIKE 'match1' Here is
SELECT * FROM tbl_group_join tgj LEFT JOIN tbl_groups tg ON tg.group_id = tgj.group_id LEFT

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.