can you use the LIMIT function like this in php
is this correct to find the first record of Royalty creditor Distributor given country, state , city
$SQLDISTRIBUTOR = " SELECT * FROM DISTRIBUTOR ";
$SQLDISTRIBUTOR.= " WHERE COUNTRYCOD =" . $_SESSION['COUNTRYCOD'];
$SQLDISTRIBUTOR.= " AND STATECOD =" . $_SESSION['STATECOD'];
$SQLDISTRIBUTOR.= " AND CITYCOD =" . $_SESSION['CITYCOD'];
$SQLDISTRIBUTOR.= " ORDER BY ACCOUNT_NUMBER ASCENDING LIMIT 1 ";
$FDISTRIBUTOR = mysql_query( $SQLDISTRIBUTOR, $CON );
Depends on what you mean by "first".
That will give the one matching the city, state, and city that has the lowest *account number*.
Which might be okay, but might be completely useless.
How can we guess?
|All times are GMT +1. The time now is 12:34 AM.|
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.