May 10, 2009

PHP/MySQL lesson #X+1

I've been on holiday and one way for me to relax is working on my website. Yes. That's right. Programming is relaxing.

So I've been struggling with this image gallery of mine... Not very relaxing! I wanted to upload images into my database and found a script tutorial for that easily enough. Done. Voila!

Then I wanted to display many of the images from my database at the same time. On my webpage. How the hell does that work??? I know how to search for them but how do I display the blob?

I searched the web again and found script after script but none of them were working! I looked for errors in the code (oh and there were errors!), tried moving things around, nothing helped. The error messages just changed... I was getting error messages, seeing a blank page... the highlight was seeing blank squares that were supposed to be images!

Turns out the code was working just fine...

But nobody told me that the table with the images isn't supposed to carry any other information (like tags for example)! As soon as I removed all the non-essential columns in my images table the script started working. Hooray!

So ONLY include the columns: id, name, size, type and content (or data, as some tutorials preferred to call it). Nothing else!

Rant over. I hope some poor soul finds this and is saved some trouble...

PS: If I'm getting something wrong please tell me. I am one of those who don't mind not knowing how a script works as long as it works. I'd love to actually study this stuff but I have other priorities.

2 comments:

XSaraXPoeX said...

Hi to you, beautiful. I hope I'm posting on the right blog. You have a few, eh? :) Missed you!

~Sara<3

XSaraXPoeX said...

I've been checking out your art and am VERY impressed! You draw some very beautiful and interesting women. I would love to read any stories you've written about your characters if you have any.

Love you, Sara<3

Post a Comment