Reply
How to store images with links in mysql database and how to....
Old 07-30-2009, 03:02 AM How to store images with links in mysql database and how to....
Junior Talker

Posts: 3
Name: Paul
Trades: 0
I was planning to set up a website for a bunch of ebooks that displays each ebook images, descriptions, and download links in a row. I know that doing it in php with mysql is the best way to go. But I've been tormentedly figuring out how would it be done. I would greatly appreciate any words from you guys. Thanks! \m/
paolo0911 is offline
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 07-30-2009, 03:27 AM Re: How to store images with links in mysql database and how to....
WebTraffic's Avatar
Extreme Talker

Posts: 215
Name: Brandon
Trades: 0
Upload all of your images into a folder named ebookimages or something like that on your hosts server.

You would then have a table in your database called ebooks. Within that table you would have the fields id (primary key, auto increment), ebookname, ebookimagelink, ebookdownloadlink, ebookdescription.

Note: The id field is so that every ebook has a unique id, each time an ebook is submitted to the table, that field tells your php script which record you are looking for.

From there it is a matter of putting stuff in the database with SQL (can be done in phpMyAdmin) and retrieving those records with PHP in a list using condition functions such as if(), else(), and while(). example..

Code:
This would display all of the ebook names within your ebooks table of your database.

// connect to database
// select table
// give your variables some value, for example tell your script that $ebookname means to pull from a specific field.

while(id > 0) {
echo "$ebookname";
}
Please excuse me if any of the syntax is wrong, I am a bit rusty on my php.


You can create a php script to add ebooks to the database using SQL through your web browser. This is how people create admin panels.

I do not know how much you know about PHP, and if you don't know any at all then you are probably wondering WHAT THE HECK IS THAT?!. If you don't know the basics, I would recommend doing some reading before you jump into it. Otherwise, you are going to end up with a huge headache. Trust me!

Last edited by WebTraffic; 07-30-2009 at 03:28 AM..
WebTraffic is offline
Reply With Quote
View Public Profile
 
Old 07-31-2009, 01:30 AM Re: How to store images with links in mysql database and how to....
Junior Talker

Posts: 3
Name: Paul
Trades: 0
Thanks Man. I'll take that. What I was trying to figure out is how to type the code for every dynamic download link on the page to be clikable.
paolo0911 is offline
Reply With Quote
View Public Profile
 
Old 08-01-2009, 04:57 PM Re: How to store images with links in mysql database and how to....
Brian07002's Avatar
Defies a Status

Posts: 1,594
Name: ...
Location: ...
Trades: 0
Quote:
Originally Posted by paolo0911 View Post
Thanks Man. I'll take that. What I was trying to figure out is how to type the code for every dynamic download link on the page to be clikable.
Also, you need to add the <a tag in the webpage to connect the table with the image in your database. It's been awhile, so explaining this is awkward for me as well.

In your page, you will need to call the image image with something like:

<img src=?img=1 width=144>

hth
__________________
Sig Less - Have some site you want me to put here? Will put here for a couple of paypal bucks.
Brian07002 is online now
Reply With Quote
View Public Profile
 
Reply     « Reply to How to store images with links in mysql database and how to....
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 



Page generated in 0.12422 seconds with 13 queries