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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T22:37:40+00:00 2026-05-30T22:37:40+00:00

I am developing a chat module with JavaScript and php+mysql and I am storing

  • 0

I am developing a chat module with JavaScript and php+mysql and I am storing the chat data into a simple table with: id, member1, member2, message, timestamp.
The timestamp column is double(14,4), where I store the timestamp on microseconds level, ex:
1330522898.3137;

My problem is:
When I am comparing this timestamp with another one, like

   SELECT * FROM chat_rows WHERE timestamp >= 1330535168.9548

Only on particular numbers, like this one above, I get 0 rows using operator >= although I have a row with exact same value; This is proved by the almost same query differentiated by operator = :

   SELECT * FROM chat_rows WHERE timestamp = 1330535168.9548

which returns one row;

The workaround for this is to replace the double(14,4) type with varchar but is slower than double;

Also fails only on this server ( my development one ):
Apache/2.2.20 (Ubuntu)
MySQL client version: 5.1.58

On my local it seems that works; – which is windows
Apache/2.2.21 (Win32) mod_ssl/2.2.21 OpenSSL/0.9.8o
Versiunea clientului MySQL: mysqlnd 5.0.8-dev – 20102224 – $Revision: 318113 $

Any thoughts ?

Thanks in advance!

  • 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-30T22:37:42+00:00Added an answer on May 30, 2026 at 10:37 pm

    The correct way to do floating-point number comparison is to first decide on an acceptable tolerance for differences between the numbers and then do the comparison against the tolerance value.

    MySQL floating point comparison issues

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

Sidebar

Related Questions

I'm developping a chat application. I want to keep everything logged into a table
I am developing a chat module for drupal. I plan to provide multiple backends
I am developing an chat application. The message display is all html, so html
I am developing a chat website using jsp/servlet.I will be hosting my website on
Hi all i am developing a chat application ... i have multiple chat windows
I am developing an application in asp.net mvc where i need to have Chat
Developing a website and just trying to get back into the swing of (clever)
I am developing a chat application. And i want to have pop up window
I'm developing a chat system. In this I'm creating dynamic tab panels in a
I m developing an Android chat application where in user will be provided with

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.