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.

Front - end design for a MySQL database

Discussion in 'HTML & Website Design' started by 2lostsouls, Oct 12, 2020.

  1. #1
    Good day everyone!
    I have a personal database of film-noir movies. I am looking for a program that I could use to build a front-end on my website to attach to the MySQL database. It will list the title, actors, plot, comments, rating and the film image. I want to be able to advance to the next movie if I want and to be able to search. I do not want to use Wordpress. I want to build it myself. I do not mind learning. Most of everything I read is building an App or using WordPress. Thank you.
    SEMrush
     
    2lostsouls, Oct 12, 2020 IP
    JEET likes this.
    SEMrush
  2. sarahk

    sarahk iTamer Staff

    Messages:
    26,437
    Likes Received:
    3,956
    Best Answers:
    111
    Trophy Points:
    665
    #2
    First up, you should consider using a framework if you're not going to use a content management system like WordPress because you don't want to completely recreate the wheel.

    You have 3 layers of information you need to work with:
    1. database - save, find, edit
    2. logic - where you get all the info you need
    3. presentation - where you plug all that info into your template
    So, your question is really about #3 Presentation.
    Find a site that gives away free HTML themes/templates - or paid if you find one that is awesome. It won't be perfect but you can remove sections, move things around - it just needs to have the kind of structure you need.

    Consider your target audience - what device is going to be used most often? I have no idea for movies but let's say it's tablets. Make sure the template you choose looks awesome for tablets and good for desktop and phone. Because we work on desktop we often make the mistake of looking at the tablet and phone versions after we're already committed.

    Once you have your template it's then just a matter of editing it and putting in the loops through your data and echoing/print into it. Some people use tools like SMARTY but that's a whole other learning curve that isn't necessary.
     
    sarahk, Oct 12, 2020 IP
    JEET likes this.
  3. 2lostsouls

    2lostsouls Peon

    Messages:
    2
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    1
    #3
    Thank you, that is very good advice. I was already looking at some templates. Have a great and safe day.
     
    2lostsouls, Oct 13, 2020 IP
    JEET likes this.
  4. c1lonewolf

    c1lonewolf Greenhorn

    Messages:
    8
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    8
    #4
    You don't need a frame work...it takes about 30 minutes to create your own content management system.
    All it is accessing the database and pulling out the info you need for front-end or back. For a basic back-end simply use a table to list textual info then build on it this is in admin directory and front can use the same to get you started. [CheatSheet - any mysql article tutorial can get you started.]
     
    c1lonewolf, Oct 15, 2020 IP
    JEET likes this.
  5. JEET

    JEET Notable Member

    Messages:
    3,492
    Likes Received:
    423
    Best Answers:
    16
    Trophy Points:
    235
    #5
    @2lostsouls

    First of all, very good decision of not using wordpress!

    As for frontend, you might need only 1 PHP file, and all you need to learn is,

    1. Learn to connect to database using PHP and MYSQLI.
    2. Learn to send a query
    3. Learn to read data from result of query
    4. Display it all

    Start PHP file like this, file named index.php

    <?php
    $dbName= "your_database_name";
    $dbUser= "your_database_user";
    $dbPass= "your_database_password";
    $dbHost= "localhost";

    echo '<!DOCTYPE html>
    <html><head>
    <title> Movie reviews, plots, ratings! </title>
    </head><body>';


    //now connect

    $mysqli= new mysqli( $dbHost, $dbUser, $dbPass, $dbName );

    //you do not want to continue if connection failed
    if($mysqli->connect_errno!=0){ echo("Connection failed \r\n".$mysqli->error); exit(); }

    //next start displaying data

    //get page number from queryString

    if( isset($_GET['page']) && is_numeric($_GET['page']) ){
    $page= $_GET['page'];
    }else{
    $page=0;
    }

    $limit = 20;
    $start= $page * $limit;

    echo '<h1>Page '. ($page+1).' of movie title, plot, ratings! </h1>';

    //in below SQL change movie_table to your own table name
    //change title, moviePlot etc to your own column names in database.

    $sql= " select title, actors, moviePlot, rating, movieImage from movie_table order by rating desc limit $start, $limit ";

    //run the query
    $result= $mysqli->query($sql);

    //show the data in HTML

    while($row=$result->fetch_array(MYSQLI_ASSOC)){
    echo '<div class="movieBox">
    <h2>'. ucfirst(stripslashes( $row['title'] )). '</h2>
    <p> Actors: '. stripslashes( $row['actors'] ). '</p>
    <p> Plot: '. stripslashes( $row['moviePlot'] ). '</p>
    <p> Rating: '. stripslashes( $row['rating'] ). '</p>
    </div>';

    }//while loop closed

    //show links for more pages
    echo '<p class="paging">';
    for($x=0; $x<=10; ++$x ){

    if( $page==$x ){
    echo " $x ";
    }else{
    echo '<a href="index.php?page='.$x.'"> '.$x.' </a>';
    }

    }//for loop closed
    echo '</p>';

    echo '</body></html>';
    ?>
     
    JEET, Oct 16, 2020 IP
  6. JEET

    JEET Notable Member

    Messages:
    3,492
    Likes Received:
    423
    Best Answers:
    16
    Trophy Points:
    235
    #6
    People use a 40,000 kb wordpress because they do not want to learn those above mentioned 20 lines of coding...
     
    JEET, Oct 16, 2020 IP
    mmerlinn likes this.
  7. c1lonewolf

    c1lonewolf Greenhorn

    Messages:
    8
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    8
    #7
    HTML Files needed for basic cms
    Front-end
    list, view

    Back-end
    login, list, view, post, update, delete and logout
    The difference between the back-end and front-end list and view pages are administration options such as "display_status" on post and update form. When set to "1" this displays the post on the front-end, "0" only displays it to admin area. Usually done for content validation or major modifications.

    Each individual list is known as a content manager (manager for certain type of content such as FAQ, movie list, audio list etc.) when more than one are used together or admin levels are used it's considered a cms (content management system) because you're managing more than one type of content.

    I have an image hosting script that I modified to use a single index.php file but allows visitors to post images and a has admin area where I can remove images or change layouts complete with error pages, about, contact and image listings and link sharing codes. It's about what you want to use and how much work you want to put into it. The script mentioned previously was a tutorial I found onloine and modified the mess out of it.
     
    c1lonewolf, Oct 20, 2020 at 3:51 PM IP