Camyden74 Posted February 4, 2012 Share Posted February 4, 2012 I'm importing posts from a csv file into a wordpress database. The upload works fine. What I need to do after the upload is then grab a csv file of the urls that where created, in the order they were created. For some reason it's pulling all of the posts urls in what looks to be random order. MySQL client version: 5.1.49 SELECT `post_content` , `guid` FROM wp_posts a LEFT JOIN wp_term_relationships b ON ( a.ID = b.object_id ) LEFT JOIN wp_postmeta c ON ( a.ID = c.post_id ) LEFT JOIN wp_term_taxonomy d ON ( d.term_taxonomy_id = b.term_taxonomy_id ) LEFT JOIN wp_terms e ON ( e.term_id = d.term_id ) WHERE e.term_id =19 ORDER BY guid ASC This gives me a great list but it is strangely random. The titles are all the same so they are appended with a number and should be in order when they post. And maybe this is the order in which the content was posted I don't know.. but shouldn't it post in the same order as my csv file? results: http://url.com/post10 http://url.com/post10 http://url.com/post100 http://url.com/post101 http://url.com/post11 http://url.com/post11 http://url.com/post111 http://url.compost112 Quote Link to comment Share on other sites More sharing options...
Camyden74 Posted February 4, 2012 Author Share Posted February 4, 2012 uhmmmm yeah I'm a moron.. lol all I had to do was order it by ID... duh! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.