php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13220 Query problem with Unix billions
Submitted: 2001-09-09 07:52 UTC Modified: 2001-09-09 07:58 UTC
From: crimson at protonic dot com Assigned:
Status: Not a bug Package: MySQL related
PHP Version: 4.0.6 OS: FreeBSD
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: crimson at protonic dot com
New email:
PHP Version: OS:

 

 [2001-09-09 07:52 UTC] crimson at protonic dot com
I'm honestly not sure if this is a PHP bug or a MySQL bug. I apologize if this is a waste of time. Here's an example script:

$timenow = time();
$red = ($timenow-345600);

$ticket_query = mysql_query("SELECT * FROM opentickets WHERE AskDate < $red");

This query returns all tickets where AskDate is earlier than the $red date, PLUS all tickets above 1 billion on the time stamp! Ack! I have resolved this by removing the single quotes from around '$red' in my query, so it reads: 

$ticket_query = mysql_query("SELECT * FROM opentickets WHERE AskDate < $red"); 

Just thought I would share this.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-09-09 07:58 UTC] derick@php.net
Not a PHP bug, queries are executed in MySQL, and MySQL returns the results.

Derick
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Jun 20 23:01:29 2024 UTC