Saving mySql row checkpoint in table?

Not sure if this is a good solution, but if I have to make nightly massive updates, I'll write the updates to a new blank table, then do a SQL select to join the tables and tell me where they are different, then do another SQL UPDATE like UPDATE table, temptable SET table. Col1=temptable. Col1, table.

Col2=temptable. Col2 ...... WHERE table. Id = temptable.id.

Thanks but that is not my issue, I what to updateor replace one row at a time. Ie 1 api call My issue is that I can compare/update all the entries as it would be too many api calls. – Keet Feb 26 '10 at 20:17.

You can store the timestamp that a row is updated implicitly using ON UPDATE CURRENT_TIMESTAMP dev.mysql.com/doc/refman/5.0/en/timestam... or explicitly in your update SQL. Then all you need to do is select the row(s) with the lowest timestamp (using ORDER BY and LIMIT) and you have the next row to process. So long as you ensure that the timestamp is updated each time.E.g.

Say you used the field last_polled_on TIMESTAMP to store the time you polled a row. Your insert looks like: INSERT INTO table (..., last_polled_on) VALUES (..., NOW()); Your update looks like: UPDATE table SET ..., last_polled_on = NOW() WHERE ...; And your select for the next row to poll looks like: SELECT ... FROM table ORDER BY last_polled_on LIMIT 1.

I'm using PHP 5 and mysqli. I have a table of chapters with columns 'id' and 'name'. Is there a simple and efficient way to query to check what index a specified row is located at?

5 | How are you? And lets say I want to find out where "How are you?" is. The desired result would be index 3 (since it is the third row in the table sorted by id ascending).

The only solution I've come up with is to query for all of them, and then in PHP loop through and find where $row"id" == 5 and figuring out what iteration it is in the loop. Is there a more efficient way to do this?

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions