You are here:

MySQL/Persisting Stored Procedure data


Hi Stuart,

I'm calling a stored procedure in MySQL thousands of times. I would like the SP to continue where it left off in terms of the values of its variables, the information inside it should persist between calls. What do you think is the best way to do this?

Thank you very much,


From what i understand you mean you are calling a function which selects data from the mysql database.

As a database is in rows you can select from a specific row, i.e select rows in range of .... from mysql table where

All you would need to do is save where you where last upto in the row, this depends on how you are calling this function, if via a browser that wont be closed of you could use a session, or if the browser is being closed off a cookie would work.

Also if the data being called is being updated as its getting call the next time it runs could be select from where update marker is 1 (this is if its a continued, else just select from ....

I hope this helps but with very little information to go on iits hard to be specific.  


All Answers

Answers by Expert:

Ask Experts


stuart gregory


PHP html, xhtml, css coding and MySQL


My experiance is all first had as I am web developer and I have, and do build many websites all using php and mysql. This ranges from building a simple search engine to secure php login scripts. Some websites like are complete database driven websites.

I have a large number of websites which I host and maintain, such as.

Web application development. (Open University) BSC Honers Computing and development (Open University)

©2017 All rights reserved.