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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:35:08+00:00 2026-06-15T12:35:08+00:00

$sql = ‘SELECT have_show FROM `date` WHERE DATE(`date`.day) = ?’; $this->db->query($sql, array($date)); //works fine

  • 0
$sql = 'SELECT have_show FROM `date` WHERE DATE(`date`.day) = ?';
$this->db->query($sql, array($date));            //works fine  

This works fine as expected.

$sql = 'SELECT actors, visitors, tickets, have_show FROM show
            JOIN `date` ON show.day = `date`.id
            WHERE DATE(`date`.day) = ?';

$this->db->query($sql, array($date));

here, with joined statements it gives 0 results.

db schema

id(AI)     day(INT FK-date.id)    actors(INT)    visitors(INT)  
  1                 2                   3               45               

id(AI)     day(DATE)               have_show(BOOLEAN)
  1       2012-12-06                       0
  2       2012-12-07                       1

codeigniter’s active records does the same.

Any of you ever suffered from this kind of poblems?

  • 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-06-15T12:35:09+00:00Added an answer on June 15, 2026 at 12:35 pm

    try this one

         $sql = 'SELECT actors, visitors, tickets, acts FROM `show`
            JOIN `date` ON show.day = date.id
            WHERE DATE(date.day) = ?';
    
        $this->db->query($sql, array($date));
    

    you have mixed between date.day and date.id.

    or maybe u have show.id not show.day so look what u have in your table and if yes

    replace in your sql show.day by show.id

    EDIT:

         $sql = 'SELECT s.day s.actors, s.visitors, s.tickets, s.acts d.day FROM `show` s
            JOIN `date` d ON s.day = d.id ';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

SQL query: select ApplicationNumber,pri_indicator,count(*) from customer group by ApplicationNumber,pri_indicator How do I do this
SQL Question: I have this query: SELECT MONTHNAME(date) AS month, Year(getdate()) AS Year, COUNT(*)
SQL Server 2005 query is as follows...... SELECT ClgId FROM IdMaker_DB WHERE Course =
Sql: SELECT date,total_usage_T1 as TotalUsageValue,'T1' as UsageType FROM TblSayacOkumalari UNION ALL SELECT date,total_usage_T2 as
SQL/PHP query works in PHPmyAdmin but not the site. I notice that many have
SQL Server 2008. I have this very large query which has a high cost
SQL 2008 : I have created a View ( select * from VW_Test1 ).
SQL SELECT IFNULL(parent, id) as p FROM article_comments WHERE article_id = 3 GROUP BY
SQL: SELECT u.id, u.name, isnull(MAX(h.dateCol), '1900-01-01') dateColWithDefault FROM universe u LEFT JOIN history h
SQL 1: select * from t1 join t2 on t1.f1 = t2.f2 SQL 2:

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.