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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T10:37:27+00:00 2026-05-15T10:37:27+00:00

The query below is not returning any results. I have copied it from a

  • 0

The query below is not returning any results. I have copied it from a query that was working and the only thing different is the addition of the following condition:

WHERE submissionid=$submissionid

Any ideas why this query is not returning any results?

$sqlStr2 = "SELECT 
                s.loginid
                ,s.title
                ,s.url
                ,s.displayurl
                ,s.datesubmitted
                ,l.username
                ,s.submissionid
                ,COUNT(c.commentid) countComments
             FROM submission s
            INNER JOIN login l ON s.loginid = l.loginid
       LEFT OUTER JOIN comment c ON s.submissionid = c.submissionid
              GROUP BY s.submissionid
             WHERE submissionid=$submissionid
             ORDER BY s.datesubmitted DESC
             LIMIT 10";

$tzFrom2 = new DateTimeZone('America/New_York'); 
$tzTo2 = new DateTimeZone('America/Phoenix'); 

$result2 = mysql_query($sqlStr2);

$arr2 = array(); 
echo "<table class=\"samplesrec\">";
while ($row2 = mysql_fetch_array($result2)) { 
    $dt2 = new DateTime($row2["datesubmitted"], $tzFrom2); 
    $dt2->setTimezone($tzTo2);
    echo '<tr>';
    echo '<td class="sitename1"><a href="http://www.'.$row2["url"].'" TARGET="_blank">'.$row2["title"].'</a>  <div class="dispurl">'.$row2["displayurl"].'</div></td>';
    echo '</tr>';
    echo '<tr>';
    echo '<td class="sitename2name">Submitted by <a href="http://www...com/.../members/index.php?profile='.$row2["username"].'">'.$row2["username"].'</a> on '.$dt2->format('F j, Y &\nb\sp &\nb\sp g:i a').'</td>';
    echo '</tr>';
    echo '<tr>';
    echo '<td class="sitename2"><a href="http://www...com/.../comments/index.php?submissionid='.$row2["submissionid"].'">'.$row2["countComments"].' comments</a></td>';
    echo '</tr>';
    }
echo "</table>";
  • 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-15T10:37:28+00:00Added an answer on May 15, 2026 at 10:37 am
    • There is c.submissionid and s.submissionid — maybe You should state in Your query which one You want to use. Example: WHERE s.submissionid=$submissionid
    • I think GROUP BY should go after WHERE clause.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The linq query below is not returning results that have been ordered by the
I have a query below that I use to retrieve the records not updated
I have a result from a query like the below, which does not have
I have a query below that is returning individual sales records with amounts for
I have a query that seems to be returning the wrong data from the
My query is like below (not working correctly) SELECT RentACar.dbo.Car.car_id as clm_CAR_ID, RentACar.dbo.Car_Image.car_image_url as
The query below returns rows that have both loginid and ip2 in the bumps
This query is not returning any result as there seems to be an issue
I have a query that should always be returning a single int. I have
I have tried the below query: select empno from ( select empno from emp

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.