1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Need Help With PHP, Pagination, MySQL

Discussion in 'PHP' started by Aceblackhat1, Feb 28, 2016.

  1. #1
    Hi programming friends,

    So I'm new to web development. I've been making desktop applications in VB.NET & designing websites for a while now, but I need to build a few websites & take it to the next level with web development.

    I'm trying to build a site that helps like music producers with Virtual Studio Technology instruments. All I really need for this type of site to have is images in a eCommerce type of layout where users can click on the images or "view details" button to read more about the "VSTi's" & click the download link to download the files.

    I would like for the site to have a PHP Pagination pulling from a MySQL Database, possibly a star rating system, & comments section so that people can rate the "VSTi's" after downloading & trying them. I need something simple & easy, similar to this site here:

    http://vst4free.com/index.php?plug-ins=Analog

    [​IMG]

    As you can see, the site above has a nice little star rating system with comments section & pagination going on.

    So my questions are:

    1. If I wanted to learn to code these types of functions, where is a good starting point for me?

    2. I've looked for training videos (tutorials) on YouTube, but wasn't able to find something that quite matched what I've seen on the website that I've mentioned above. What is a good learning resource as far as videos go? Anybody know of any video that can help me with these types of functions?

    3. What is a great book/books to get to learn how to create a similar site?

    I would appreciate the help. I'm just really interested in learning, getting my feet white at this point. Thanks again for any support.
     
    Aceblackhat1, Feb 28, 2016 IP
  2. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #2
    What you're requesting is fairly basic. Any pagination-tutorial for PHP would work (how you implement it on the page is not really part of the back-end functionality). Just make sure that whatever tutorial you pick, don't pick one that uses the mysql_ db-connection - it's deprecated, prone to security-issues, and generally not recommended. Instead, use mysqli_ or PDO, which allow for prepared queries, and provides built-in security against SQL-injections and so forth, if you use it correctly.

    Personally I hate videos, so I can't really help you there, but my suggestion would be that you have a look around on this forum - there are quite a few threads on here that will tell you how to make something similar (maybe not ONE thread that has everything, but if you add the information from several together, it should be fairly easy).

    You would need to create a database, of course, and tables for the downloadable items (do NOT store those in the database, however, just store a link to the file on the filesystem), one table for the ratings, and so on. Perhaps even having a user-table, so that only logged in users can comment and rate (helps reduce spam and fake ratings).

    The functionality you're wanting could fairly easily be done with something like Wordpress, with plugins (maybe even a webstore-front-end) - if you don't feel confident programming the whole thing, that is.
     
    PoPSiCLe, Feb 28, 2016 IP
  3. Aceblackhat1

    Aceblackhat1 Active Member

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    56
    #3
    Wow! Thanks PoPSiCLe!!! I was looking for a "thanks button" but couldn't find one. I didn't know that MySQL database connection was deprecated or prone to have security issues. That's something new to me!

    I personlly LOVE videos since I'm a visual learner, like listening & seeing things in action. The video tutorials is what I prefer, but if you can recommend a good read, I would be willing to go that route as well. Is there any "Pagination" tutorials here that is similar to the website that I've linked to? What kind of database do you think this person used when coding the vst4free.com website??? Thanks again!

     
    Aceblackhat1, Feb 28, 2016 IP
  4. Aceblackhat1

    Aceblackhat1 Active Member

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    56
    #4
    How do I get the MySQLi type of database??? Is it something extra that I need to download???
     
    Aceblackhat1, Feb 28, 2016 IP
  5. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #5
    You misunderstand. You still use MySQL - the _database_ isn't deprecated. However, within PHP, there are three ways of connecting to said database. The one which is deprecated, is mysql_
    The one I recommend is PDO, which have several benefits over the other recommended alternative, mysqli_

    PDO can connect to most any database out there, so you could use something else than MySQL if you wanted to, but there isn't really any need for something else for such a site.

    I can't really recommend any tutorials, as I haven't used any for ages - most of what I used are probably removed, outdated or similar.

    However, you might find something useful in this thread here: https://forums.digitalpoint.com/threads/pagination-trouble.2765688/
     
    PoPSiCLe, Feb 28, 2016 IP
  6. Aceblackhat1

    Aceblackhat1 Active Member

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    56
    #6
    LOL Okay, right as you were writing this to me, I was already watching a tutorial that said "mysql & mysqli are the same thing". HAHA
    So basically, "pagination" is just querying a database right? How would I structure the page #'s at the bottom of the site the way that this person did on vst4free.com?
    Is that all in the <div> placement & css styling as to how it will show up on the site after using the "pagination"? Thanks again my friend.
     
    Aceblackhat1, Feb 28, 2016 IP
  7. Aceblackhat1

    Aceblackhat1 Active Member

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    56
    #7
    Oh & I forgot to mention earlier that I WILL NOT use wordpress for building ANY of my sites. I want to learn how to code manually myself. LOL Thanks again.
     
    Aceblackhat1, Feb 28, 2016 IP
  8. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #8
    Basically, you style the content/links as you want - usually you'll build the pagination with a list - the content of that list will usually be numbers, or just next/prev, with links to the pages (so if someone loads domain.com/page=3 it will actually load the given page, not the first one.
    Depending on how many items you'll load in total, you might also consider having an option to "show all" if customers want to see everything at once, sort by rating, or name, and such different options.
    Pagination is basically just a query of the database, with limits on how many elements is shown at the time.
     
    PoPSiCLe, Feb 28, 2016 IP