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
 [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

Pull Requests

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: Sun Dec 22 05:01:30 2024 UTC