php-windows | 2003032
Date: 03/17/03
- Next message: Luis Ferro: "Re: [PHP-WIN] RE: IDE's"
- Previous message: Nick: "[PHP-WIN] PHP 4.3.1 Installer - Windows 98 - PWS HELP!!!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
First of all it looks strange to have a assign condition in
the SELECT part of the query, e.g "ID = max(ID)".
You might like to do it this way instead:
SELECT ID,Date,TimeIn,TimeOut,StationIP
FROM Clocks
WHERE ID = (
SELECT MAX(ID)
FROM Clocks)
-----Original Message-----
From: GeneralX
To: php-windows <email protected>
Sent: 2003-03-15 06:46
Subject: [PHP-WIN] ODBC Query max()
I'm trying to extract one record that has largest sequence ID number
for an employee, so I've tried below but doesn't work. Help.
$mQuery = "EmployeeID = '$user'";
$mCur = odbc_exec( $mCnx, "select
ID=max(ID),Date,TimeIn,TimeOut,StationIP
from Clocks where $mQuery" );
-- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
- Next message: Luis Ferro: "Re: [PHP-WIN] RE: IDE's"
- Previous message: Nick: "[PHP-WIN] PHP 4.3.1 Installer - Windows 98 - PWS HELP!!!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

