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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T22:39:03+00:00 2026-06-16T22:39:03+00:00

When I try the follow mysql query in send I just get back an

  • 0

When I try the follow mysql query in send I just get back an empty results set (who suposed to be filled).

I tried the follow query in my mysql workbench (gives a results back)

SELECT `websites`.*, `s`.`website_id` AS `websites.id` 
FROM `websites` 
INNER JOIN `websites_statistics` AS `s` ON `s`.`website_id` = `websites`.`id` 
WHERE `websites`.`website` = 'google.com' LIMIT 0,1

And this one in my ZF2 application (empty result set)

$sql = new Sql($this->tableGateway->getAdapter());

    $select = $sql->select();
    $select->from('websites')
           ->join(array('s' => 'websites_statistics'), 's.website_id = websites.id', array('websites.id' => 'website_id'), \Zend\Db\Sql\Select::JOIN_INNER)
           ->where(array('websites.website' => 'google.com'));

    $resultSet = $this->tableGateway->selectWith($select);

    echo $select->getSqlString();

    return $resultSet;

Debug result:

SELECT "websites".*, 
"s"."website_id" AS "websites.id" 
FROM "websites" 
INNER JOIN "websites_statistics" AS "s" ON "s"."website_id" = "websites"."id" 
WHERE "websites"."website" = 'google.com'

(!updated) The query a bit so it’s more easier. I think there goes something wrong at the first moment because I think “s”.”website_id” AS “websites.id” has to flip in the other direction .. “websites.id” AS “s”.”website_id” I need websites.id to take record by website_id from the websites_statistics table.

Thanks in advance!

Nick

  • 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-16T22:39:05+00:00Added an answer on June 16, 2026 at 10:39 pm

    I got it work. The problem wasn’t the query it’s self. I had to add the fields of the second table (to one I join) to the model (exchangeArray) of the first table! That did the trick. Thanks you all.

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

Sidebar

Related Questions

I just follow this DIHQuickStart , try to import data to solr from mysql.
I just typed the follow to try and get my SharePoint site: $spWeb =
I try to work with ctags and it simply doesn't work. I follow this
I am trying to follow this tutorial ( Using-core-plot-in-an-iphone-application ). When I try to
I try to get this following url using the downloadURL function as follows: http://www.ncbi.nlm.nih.gov/nuccore/27884304
I'm doing a HQL query as follows, and try to order the list by
I've got a MySQL query somewhat like the following: SELECT * FROM products LEFT
NO MySQL answers please! The basic query is as follows (assume A is Key)
Currently having problem with a SQL query, It is as follows UPDATE table SET
OK, I'll try and make this as easy to follow as I can! Background:

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.