Archive

Archive for the ‘Uncategorized’ Category

Exec-PHP Not Displaying Categories or Archive List

March 8th, 2009

I’m currently in the process of converting one of my old sites from Moveable type to Wordpress. The site hasn’t been updated since 2007 and all the pages were static pages. I decided to port it over to wordpress and make it dynamic by getting offer information from a database.

I decided to store the offers in a database because in the past, I would get calls from the networks telling me that the wording on a page was incorrect and that I had to change it before a specific day or my affiliate link would be deactivated. This meant that I had to go to every page where the offer was listed and manually make the corrections on each page.

With the offers now stored in a database, I can just make changes in one place and the information will be automatically updated on all the pages where the offer is displayed.

Exec-PHP Plugin

With a standard installation of Wordpress, you are not allowed to include any php code in any of your posts or pages, unless you get sometype of plugin which will allow you to do so. I decided to go with the Exec-PHP plugin by Sören. There are other plugins out there that get the job done, I just settled on this one based on the number of downloads it had compaired to the others.

The plugin works great. I was able to query the mysql database and display the information within a wordpress post or page. The only problem was that when queried the database using php, my category list and archive list would become empty. I didn’t know exactly what was causing it or why. I checked everything that I could possibly check to find out what was causing this. I checked the code for the sidebar, checked my php code, checked the template code, nothing.

After scratching my head for hours, I finally figured out what was causing this. It was happening because the user name and password that I used to query my offers database was the same username/password that wordpress used to run the site.

Since my code was executed first, I was able to connect to the database and get the information that I needed and then close the connection. Once I closed the connection, wordpress no longer had a way to get the information about the categories and posts, so it displayed nothing.

The moral of the story is this:

If you use the exec-php plugin for wordpress to retrieve information from a database, make sure that you do not use the same database username that you’re using to run your wordpress site. Create a different user to use with the exec-php plugin.

Uncategorized , ,

It’s Not Easy Getting Gold

January 3rd, 2008

American Express Gold Business CardAlthough I’m content that I have an American Express card, getting it wasn’t an easy task. I first applied for the card online on November 14. After applying, I had to contact someone at American Express to verify some information. They wanted to verify my home address and business information.

After all that, the guy on the phone approved my application and congratulated me. I couldn’t believe that I had been approved! I was so excited. I asked for re-assurance that I’d get the card and he assured me that he had approved my application and that I’d receive the card in 7-10 business days.

Fast forward 7-10 days later and guess what? I didn’t receive a damn card! Instead, all I got was some shitty letter stating that after a careful review of my credit report, they decided not to grant me the card. I was so furious that day. I called and complained and all thy told me was that they were sorry and that whoever approved me for the card shouldn’t have said I was approved ( your lucky I never got your name, buddy).

After that harsh denial, I was certain that I’d never get approved for this business gold card that I desperately needed and wanted. Despite being down, I decided to apply for the card again. Because if at first you don’t succeed? Try again!

I applied for the card a second time on December 12, close to 1 month after the initial attempt. The application process was the same. I applied online and verified some information over the phone. During the phone conversation, I was once again approved for the card. This time I didn’t get too excited. After all that happened the first time, I was certain that I was going to get another denial letter in a few days.

For the next 7-10 days, I literally called American Express every single day to make sure that I was going to receive my card this time. Each time I spoke to a representative, I got their name and id #, in case I had to complain if I were denied.

On December 21, I received a nice package from American Express with my brand new card.

Damn it feels good to finally be a member.

Uncategorized