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
  • Some links to purchase linux boxed set installs OK, truth be told linux is usually thought of as a download for free and install operating system and there are LOT's of ways to do that. But it is also available for purchase at various places, from the different distributions web sites. Also, these are links to the product......
  • Rsync for easy (and quick) backups I've got to say, I haven't spent ENOUGH time with rsync to really be fluent in how I could put it to use.... A week or so ago I was reading this list of essential Linux software by a guy that moved from Mac OS X to linux because he......
  • How to Remove TRE Antivirus | TRE Antivirus Removal Guide TRE Antivirus is a new entry in the Wini Family of rogue antivirus software. This family includes SoftCop (SoftCop Removal), Softsoldier (How to remove SoftSoldier), ( TrustFighter TrustFighter Removal Guide, TrustSoldier removal guide and the following others... SafeFighter (Safefighter Removal), TrustCop (TrustCop Removal Guide), SecureWarrior (SecureWarrior Removal), SecurityFighter (SecurityFighter Removal),......
Blog Traffic Exchange Related Websites
  • Our Organic SEO Process Organic search engine optimization Consists of Many Parts, Each On-page and Off-page. Website Evaluation We first want to determine in case your site has bad website positioning, or zero SEO. We consider the negatives and positives with a purpose to determine if we may help your enterprise obtain natural internet......
  • Top Five Tips For Successful Link Building Good search engine optimizers (SEO´s) understand the importance of building a network of incoming links to their page in order to improve ranking results in the major search engines, but in their scuffle to push their web pages to the top, some of them are forgetting the old adage “work......
  • Creating Links With Content There are many people out on the web who create a simple presence with the hope of being able to earn money online. Usually the presence has very little content and a ton of affiliate programs or other monetization links. When you create a presence with little content then the......
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