in reply to Re: Reading A TAble
in thread Reading A TAble

Ok, but doesn't this method take a lot of memory??

And, do you know the syntax of the select command to read by primary key or another index key? Thanx.

Replies are listed 'Best First'.
Re^3: Reading A TAble
by Ieronim (Friar) on Jul 12, 2006 at 22:19 UTC
    Just let MySQL do its work :) The memory management for each request isn't your task, it's the task of database engine.

    the syntax of the select command to read by primary key or another index key?
    I did not understand your question. Maybe you want to get the data corresponding to a key? In this case you need to specify the WHERE clause to read only certain data from the table, e.g.

    SELECT id, name FROM mytable WHERE id=1
    I repeat: RTFM! MySQL documentation contains the full info on SQL syntax. 10 minutes of reading the docs will save for you hours of asking questions :)
Re^3: Reading A TAble
by duckyd (Hermit) on Jul 12, 2006 at 20:47 UTC
    Accessing the table in the method you described should not load the whole table into memory. If you'd like to order the results by some field (primary key or otherwise), use an ORDER BY clause in your select statement.