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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
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 Mar 28 17:01:29 2024 UTC