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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T21:07:46+00:00 2026-05-14T21:07:46+00:00

The HTML table below with mysql_query($sqlStr3) (the one with the word Joined in its

  • 0

The HTML table below with mysql_query($sqlStr3) (the one with the word “Joined” in its row) does not echo if the result associated with mysql_query($sqlStr1) has a value of zero. This happens even if mysql_query($sqlStr3) returns a result.

In other words, if a given loginid has an entry in the MySQL table “login”, but not one in the MySQL table “submission”, then the table associated with mysql_query($sqlStr3) does not echo.

I don’t understand why the MySQL “submission” table would have any effect on mysql_query($sqlStr3), since the $sqlStr3 only deals with another MySQL table, called “login”, as seen below.

Any ideas why this is happening?

Thanks in advance,

John W.

<?php

echo '<div class="profilename">User Profile for </div>';
echo '<div class="profilename2">'.$profile.'</div>';

$tzFrom = new DateTimeZone('America/New_York'); 
$tzTo = new DateTimeZone('America/Phoenix'); 

  $profile = mysql_real_escape_string($_GET['profile']);

  $sqlStr = "SELECT l.username, l.loginid, s.loginid, s.submissionid, s.title, s.url, s.datesubmitted, s.displayurl
               FROM submission AS s
         INNER JOIN login AS l
                 ON s.loginid = l.loginid
              WHERE l.username = '$profile'
           ORDER BY s.datesubmitted DESC";

  $result = mysql_query($sqlStr);

$arr = array(); 
echo "<table class=\"samplesrec1\">";
while ($row = mysql_fetch_array($result)) { 
    $dt = new DateTime($row["datesubmitted"], $tzFrom); 
    $dt->setTimezone($tzTo);
    echo '<tr>';
    echo '<td class="sitename3">'.$dt->format('F j, Y &\nb\sp &\nb\sp g:i a').'</a></td>'; 
    echo '<td class="sitename1"><a href="http://www.'.$row["url"].'">'.$row["title"].'</a></td>';
    echo '</tr>';
    }
echo "</table>";    

  $sqlStr1 = "SELECT l.username, l.loginid, s.loginid, s.submissionid, s.title, s.url, s.datesubmitted, s.displayurl, l.created, count(s.submissionid) countSubmissions
               FROM submission AS s
         INNER JOIN login AS l
                 ON s.loginid = l.loginid
              WHERE l.username = '$profile'";


  $result1 = mysql_query($sqlStr1);

$arr1 = array(); 
echo "<table class=\"samplesrec2\">";
while ($row1 = mysql_fetch_array($result1)) { 
    echo '<tr>';
    echo '<td class="sitename5">Submissions: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.$row1["countSubmissions"].'</td>';
    echo '</tr>';
    }
echo "</table>";    


  $sqlStr2 = "SELECT l.username, l.loginid, c.loginid, c.commentid, c.submissionid, c.comment, c.datecommented, l.created, count(c.commentid) countComments
               FROM comment AS c
         INNER JOIN login AS l
                 ON c.loginid = l.loginid
              WHERE l.username = '$profile'";


  $result2 = mysql_query($sqlStr2);

$arr2 = array(); 
echo "<table class=\"samplesrec3\">";
while ($row2 = mysql_fetch_array($result2)) { 
    echo '<tr>';
    echo '<td class="sitename5">Comments: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.$row2["countComments"].'</td>';
    echo '</tr>';
    }
echo "</table>";    


$tzFrom3 = new DateTimeZone('America/New_York'); 
$tzTo3 = new DateTimeZone('America/Phoenix'); 


  $sqlStr3 = "SELECT created, username
               FROM login 
              WHERE username = '$profile'";


  $result3 = mysql_query($sqlStr3);

$arr3 = array(); 
echo "<table class=\"samplesrec4\">";
while ($row3 = mysql_fetch_array($result3)) { 
    $dt3 = new DateTime($row3["created"], $tzFrom3); 
    $dt3->setTimezone($tzTo3);
    echo '<tr>';
    echo '<td class="sitename5">Joined: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.$dt->format('F j, Y').'</td>';
    echo '</tr>';
    }
echo "</table>";    

?>

</body>
</html>
  • 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-14T21:07:46+00:00Added an answer on May 14, 2026 at 9:07 pm

    If I understand the problem correctly, you need to echo out $dt3->format('F j, Y') instead of $dt->format('F j, Y') in one of the last lines of the code you have.

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

Sidebar

Related Questions

The HTML table below is paginated. On page one, $count++ starts at one and
Given the following html table and script shown below I am having a problem
I m new with jquery.Below is my html table which is in content page.In
I want to add Excel button below the html table, that gives an Excel
Below is my HTML : <table width=100% > <tr> <td> <asp:TextBox ID=tbNewNote TextMode=MultiLine runat=server
Please check my HTML below: <table cellpadding=0 cellpadding=0 border=0> <tr> <td> <div class=toogler>Demo1</div> </td>
see fiddle i have html table and one textbox and one button.make cell selection
In the HTML table below, I would like to add a third column that
I am not getting the proper representation of an HTML table after inserting php
The code below echoes out an HTML table, populated with values from a MySQL

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.