In message <[EMAIL PROTECTED]>, Kaela Street
<[EMAIL PROTECTED]> writes
>
>
>You say --
>>Use
>>SELECT appid FROM mytable ORDER BY appid;
>>
>>to return the rows in the order that you want them.
>>
>>Or perhaps you mean
>>SELECT appid FROM mytable WHERE appid > last_id_that_I_was_looking_at
>>ORDER BY appid LIMIT 1;
>>
>
>If you are looking for a single row to be returned, why use "LIMIT 1",
>Would it not be as good to use mysql_fetch_row(), such as :-
>$Myrow = mysql_fetch_row ( mysql_query("SELECT appid FROM MyTable
>ORDER BY appid"));
Because your query (mysql_query) returns ALL records from the table,
then you only look at (mysql_fetch_row) one of them.
My query only returns the one record which is required from the table.
And you should never return more rows or fields than you need, as it can
seriously impact on performance.
--
Pete Clark
http://www.hotcosta.com
http://www.spanishholidaybookings.com
The PHP_mySQL group is dedicated to learn more about the PHP_mySQL web database
possibilities through group learning.
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/php_mysql/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/