PHP Link Directory and Importing Links



I’ve fought this evening with Php Link Directory. I had a list of addresses I wanted to add in bulk and managed to string together the correct format of a csv file for import. It’s somewhat of a long story, it started with lynx dumping the source of a web page, sed trimming just the links, then just the link titles, etc. Finally a few scripts later I had a basic spreadsheet. Added NULL values in a few fields and tried the import. Everything looked good, so I thought I’d test adding a link through the user interface and see if everything was good.

At this point I noticed that my imported links weren’t displaying. My first guess was that the cache needed clearing, but that didn’t solve it, so I looked at the database. I had forgotten to set the expiration date to NULL for all of them. (The new links had defaulted to 0). Okay, so I added a link and then noticed one of my imported links had vanished. I suspected that the auto-increment of mysql had failed to acknowledge the imported data. I went through alter-ing the table to set the auto-increment value higher, but it still stomped over existing records when adding a link through the user interface.

Strangely the following command didn’t seem to work…
ALTER TABLE name_of_table AUTO_INCREMENT = 500

Finally, I dropped the id field entirely and recreated it. Autonumbering gave me numbers up to 404, so I added a new link to test and id #395 was stomped (the id had already been used by another link, but now it was replaced with the new link.)…. but I thought dumping the ID field would make it forget… At that point I noticed a little table with one field called PLD_Link_SEQ… the one field was id and… it was displaying 395… (smack head!) So, I updated that to 405 and added a link and all worked as expected.

As an odd side effect, it looks like if a link had been featured and it’s number was claimed by a new link, the new link automatically became featured as well.

So, if you try importing links into phpld from a self made csv or other import file, make note of the PLD_LINK_SEQ table and make sure to set it to a number so it doesn’t “step on” your previous entries.

My other suggestion if you’re going to do an import like this from csv. Start by downloading a backup in csv format of your current links. Do this so you can make sure you have the correct number of columns. (Even if you put NULL in the last column, that’s fine.) You might want to prepare yourself for the possibility of doing MYSql commands after the import. I had to set the expire date field to NULL where the expire date =0 (With the expire date at 0 the link doesn’t show.) So, brush up on your sql query syntax before you start importing.

Related Posts

Blog Traffic Exchange Related Posts
  • More on the Sony XCP DRM (Rootkit) Freedom-to-tinker.com has some good detailed analysis on Sony's (mis) use of GPL software in their XCP DRM (Digital Rights Management) software that's been at the center of somewhat of a firestorm the last couple months. DRMS was the source of the code that was allegedly misappropriated, but the puzzle was......
  • Migrating Contacts from Evolution to Kontact I've toyed around with the idea of migrating everything over to Kontact for my mail. I've used Evolution since moving over to linux, but there are some things about Kontact that just seem slicker to me. While I was doing the install, I had the laptop setup to receive messages......
  • Way Off-topic... The World Cup, Soccer (football) and the U.S. As most people have heard, the World Cup is over. Italy has won and a month-long tournament to choose the true WORLD champion of Soccer (outside the US football) is over. Thirty-two nations sent their teams to compete after a LONG qualifying process and of course, there are lot's of......
Blog Traffic Exchange Related Websites
  • Personal Finance Links ("Big Sign" Edition) Whenever I'm driving, I hand my wife navigating duty. I'm directionally challenged and I know it. Well, she'll make a comment that there's a "big sign" coming up for me to follow and I look for the physically large sign. It took me a long time to catch on that......
  • Conducting SEO Doing SEO is not a whole lot. We are just going to pursue specific great methods which take up a major role in providing heavy traffic to a website. Certainly one of those worthwhile methods is link building techniques. Now, here, you'll find some great benefits of performing link......
  • Advice Before Starting Your Link Building This article is a guide to understanding the main link building choices open to you. It could be really complicated for people today looking for suggestions and information on making inbound links as you will find so several methods to build them, lots of different guidelines and elements to......
en.pdf24.org    Send article as PDF   

Similar Posts


See what happened this day in history from either BBC Wikipedia
Search:
Keywords:
Amazon Logo

Comments are closed.


Switch to our mobile site