>Also, when the data gets inserted into the database, it doesn’t get added in the order it should. How can I fix that?
The “order” that records are stored in is irrelevant in SQL (and can’t really be relied on anyway). The meaning of any one record should not depend on other records in the same table. If you need to sort the records according to some particular info, you need to add that info to the record. I assume you want to order them in “the order I read them”?
> I assume you want to order them in “the order I read them”? –@traq
Yes, that’s exactly what I want to do. It should look just like the insert code you posted in that gist. Where the latest article I’ve read is first.
While posting that screenshot, I noticed that the INSERT data is not showing all the articles. It shows `Google Maps Update: 2013` as the first but yet `Kirby loves MySQL` is actually the first. Perhaps it’s an issue with output because all the articles I’ve read are in the database.
Does readability tell you _when_ you read each article (a timestamp, or something? I saw a pubdate attribute, but that’s not really what we want)? Or do we just have to rely on the order readability returns the items in?
>I noticed that the INSERT data is not showing all the articles. It shows Google Maps Update: 2013 as the first but yet Kirby loves MySQL is actually the first. Perhaps it’s an issue with output because all the articles I’ve read are in the database.
Actually, I don’t see the Kirby article returned in readability’s response at all anymore. Perhaps they only serve the 15 most recent? If that’s the case, you might want to keep your existing records before rebuilding the DB table.
`#1064 – You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘NOT NULL UNIQUE AUTO_INCREMENT ,`title` VARCHAR( 50 ) NOT NULL ,`url’ at line 2
CREATE TABLE `read`(
`order` NOT NULL UNIQUE AUTO_INCREMENT
,`title` VARCHAR( 50 ) NOT NULL
,`url` VARCHAR( 50 ) NOT NULL
,PRIMARY KEY( `title`,`url` )