Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
06-20-2013, 05:00 PM #1
- Join Date
- Jul 2010
- Thanked 0 Times in 0 Posts
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 );
06-20-2013, 07:13 PM #2
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?
Be yourself. No one else is as qualified.