emulating seed / limit with arrays.

admin

Administrator
Staff member
I am curently trying to use a SEED and LIMIT value for an sql query and display the requested rows with mysql_fetch_array.

This presents the problem of reformating the SQL statement everytime. Although I overcame this problem with some practice, I now notice that I brought on to my self a greater problem. By having to reformat the SQL statement, I have to format all other values (search value, category value, etc..) as well as reconnec to mysql and so on and so on. Usualy this would not be a problem, but I also belive I did not find a proper logic of sorting the collection of scripts (include files) properly.

to make a long question short:

can I take all values from a returned sql statement, enter them all into an array (or multidimentional array) and manipulate that array over and over again without connecting to mysql? ..

also, can I (more importently) LIMIT the result and navigate between SEED and LIMIT ?

ex:
2000 products match.
Start at 0 (seed) through 20(limit)
Start at 20 (seed) through 40(limit)
... and so on.

(will the key() of an array returned from mysql_fetch_array() come in numerical index?)..


as you can see I'm still very much in the dark.

thank you in advance for any advice.
Eyal.
 
Back
Top