Re: ODBC Query max()
| From: | Thomas Smart | Date: | Sat, 15 Mar 2003 10:08:29 +0000 |
| Subject: | Re: ODBC Query max() | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-19022@lists.php.net to get a copy of this message | ||
this is a mysql query for heighest id, maybe it helps
// get highest ID from database
include 'includes/connect.php';
$query1=MYSQL_QUERY("SELECT max(id) as max_id FROM $ctableuk");
$getvar=MYSQL_FETCH_ARRAY($query1);
$id=$getvar["max_id"];
mysql_close();
if (!isset($id)){$id="1";}
"Generalx" <song@isot.com> wrote in message
news:20030315034329.26312.qmail@pb1.pair.com...
> 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" );
>
>
>