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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:05:38+00:00 2026-05-28T14:05:38+00:00

so here is my code and I will tell you the problem after that:

  • 0

so here is my code and I will tell you the problem after that:

<script language='javascript' type='text/javascript'>
    setInterval( function() {
    $('#responsechat<?php echo $otherchatuser ?>').load('echogetconversation.php?username=<?php echo $username; ?>&otherchatuser=<?php echo $otherchatuser; ?>&numberofmessages=<?php echo $numberofmessages; ?>');
    <?php
    $subtractlogintime8 = time() - 600;
    $data8 = mysql_query("SELECT * FROM loggedin WHERE username='$otherchatuser' and time > '$subtractlogintime'");
    $numrows8 = mysql_num_rows($data8);
    ?>
    if (<?php echo $numrows8; ?> == 1 )
    {
    document.getElementById("checkloggedin<?php echo $otherchatuser; ?>").innerHTML = '<img src="loggedin.png">';
    document.getElementById("checkloggedin<?php echo $otherchatuser; ?>").style.marginLeft = '5px';
    }
    else
    {
    document.getElementById("checkloggedin<?php echo $otherchatuser; ?>").innerHTML = '';
    }
    }, 4000);
    </script>

This is my code, which gets users who are logged in and also does other things. The problem that I am having occurs on this line:

 $data8 = mysql_query("SELECT * FROM loggedin WHERE username='$otherchatuser' and time > '$subtractlogintime'");

The query successfully gets users from the database, but seems to be ignoring the “and time > ‘$subtractlogintime'”);” part of the query. I have no idea why this is occurring and anyone who could possibly tell me what I have forgotten would be extremely appreciated. Thanks.

  • 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-28T14:05:39+00:00Added an answer on May 28, 2026 at 2:05 pm

    TIME is a reserved keyword in MySQL because of the TIME datatype. If it’s not crashing, you would probably better off backticking your “TIME” keyword to refer to the field time.

    $data8 = mysql_query("SELECT * FROM loggedin WHERE username='$otherchatuser' and `time` > '$subtractlogintime'");
    

    Also note that, this code COULD be prone to SQL injection but we can’t be sure without seeing the full code…

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

Sidebar

Related Questions

I am trying to reduce some code here. I will explain how I have
It's pretty difficult to show code for ASP.NET here, so I will try my
Here a code to demonstrate an annoying problem: class A { public: A(): m_b(1),
enter code here Hi All, I have a simple windows service application that connects
I wrote a page by javascript that has over 1000 lines of code and
I've got some code that uses type-punning to avoid having to call a member
I'm working on a program that will tell what level a programmer is at
THE EXAMPLE First and foremost, here's my code and problem: http://www.nathanstpierre.com/MBX/showoff.html THE ISSUE So
Ok the error is showing up somewhere in this here code if($error==false) { $query
Here is code from MSDN . I don't understand why the work isn't just

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.