DESC order results
| From: | Danny Brow | Date: | Sun, 13 Jan 2008 18:54:53 +0000 |
| Subject: | DESC order results | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-267190@lists.php.net to get a copy of this message | ||
Just wondering if anyone could tell me how reliable the DESC order
option is going to be when I am parsing thousands of records where they
are multiple ChartNo's for the same clientNo. Or is there a better way
to grab the most recent ChartNo.
$link = mysql_connect('localhost', 'myuser', 'mypassword') or
die('Could
not connect: ' . mysql());
mysql_select_db('mydatabase') or die('Could not select database');
$query = 'SELECT * FROM eChart WHERE clientNo = "2" ORDER BY ChartNo
DESC';
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
$line = mysql_fetch_array($result, MYSQL_ASSOC);
// Just for testing....
print mysql_num_rows($result);
Thanks,
Dan
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.