Need some help!

They have: 13 posts

Joined: Jul 2005

I have a page on my website for funny videos, I would like 10 videos on each page and a page selection at the bottom, something like... <3|4|5|6|7|8 next>>, or something similar, but I don't want to have to manualy sort the pages each time I get a new video, e.g. when I get a new video I don't want to have to take the last video from page 1 and put it first on page 2, then take the last video from page 2 and put it first on page 3 and so on... I want it to sort its self out, how would I go about doing this? By the way, I'm new to PHP and don't have a clue how to use MySQL, but I do have access to both!

Cheers Laughing out loud

Busy's picture

He has: 6,151 posts

Joined: May 2001

Sounds like the perfect time to learn a new skill Wink

To do it automatically you need to use a database (mysql is perfect), the page numbering is sorted by the database query (the php uses the mysql database to get and sort the data).
Ideally you should learn how to do it yourself, we could give you the code and send you on your way but if it breaks or you want to modify it you'd be stuck, but if you created it (and it is pretty easy) then you'd be able to fix/update/enhance it if/when needed.
Have I sold you on learning it? want some links? say yes within the next ten days and I'll throw in some helpful hints, last weeks lotto numbers and someones phone number (well it could be, is just random numbers that look like a phone number). Oh and say yes now and you could be the proud owner of a new addiction Wink

No medication was taken while thinking or writing this post

They have: 75 posts

Joined: Mar 2000

I'm not the originator of the thread...

but I am also VERY new to MySQL and PHP. But, I already know I *really* want to learn both. So, toss those links up!

Smiling

Infact, I've been out of web stuff for *many* years and I need to refresh on everything, truly. So any/all helpfull links to the best sites would be appreciated Wink.

-tallon

They have: 13 posts

Joined: Jul 2005

I would prefer the codes rather than the links, I have tried a few times to learn MySQL, but its just soooo boring, all the books I have read on mysql just go on about how the databases work and not really about how to use them, I don't care how they work, I don't no how a lot of stuff works but I can still use them. I have taught my self all I know about making websites from just messing about with dreamweaver, and I think it would be easier for me to learn mysql if I were just thrown into the deep end with no training and just left to figure it out my self, if I run into a problem I will just search the net for solutions, I'l soon get the hang of it Laughing out loud

I already no a little bit about accessing mysql databases, but I don't no how to use them Sticking out tongue

Busy's picture

He has: 6,151 posts

Joined: May 2001

http://dev.mysql.com/doc/mysql/en/index.html - start at section 3, then sections 11, 12 and 13 then A and B (which is after 25)

http://www.php.net/ - the manual is a bible, it lists every function there is and it will show you how and why. There is a simple tutorial there but very simple. You'll need this to 'talk' to the database.

Once you have the basics done (ie set up the database and made sure you can run PHP ..) it's time for some links, unfortunity to create this page number example would make this page very long as I'd have to first create the database, add some content via some method to get it in there, then have to out put the data and sort it with next and previous.
with the help of google, I found some links that look good, although you will need to combine some as they all miss a bit here and there:

http://www.phpfreaks.com/tutorials/73/1.php
http://www.faqts.com/knowledge_base/view.phtml/aid/35455
http://www.devpapers.com/article/35
http://www.zend.com/codex.php?id=1225&single=1

and each is done in a slightly different method

hotscripts.com may have some pre made scripts, or google may show you some better results

timjpriebe's picture

He has: 2,667 posts

Joined: Dec 2004

Adam, I know that the Gallery software version 1.X would handle this sort of thing nicely. I'm just now experimenting with 2.0, so I'm not sure how well it handles it.

It's primarily for pictures, but handles videos as well. Not sure how/if you can set custom thumbnails, though, for videos.

http://gallery.menalto.com/

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.