2. E – Commerce Website PHP Tutorial – MySQL Database and its Tables




Series: http://www.developphp.com/video/PHP#eCommerce-Website-Tutorial Source Download: …

Original source


25 responses to “2. E – Commerce Website PHP Tutorial – MySQL Database and its Tables”

  1. This also may help:

    <?php

    echo "<html>
    <head><title>Test MySQL</title></head>
    <body>";

    $host = "localhost";
    $user = "root";
    $password = "";
    $cxn = mysqli_connect($host, $user, $password);
    $sql = "SHOW DATABASES";
    $result = mysqli_query($cxn, $sql);

    if ($result == false) {
    echo "<h4>Error: ".mysqli_error($cxn)."</h4>";
    } else {
    if (mysqli_num_rows($result) < 1) {
    echo "<p>No current databases</p>";
    } else {
    echo "<ol>";
    while ($row = mysqli_fetch_row($result)) {
    echo "<li>$row[0]</li>";
    }

    echo "</ol>";
    }

    }

    ?>

    </body></html>

  2. If you are viewing this in 2017, for your " connect_to_mysql.php" use the code below;
    <?php
    $con = mysqli_connect("localhost","username","password","database");

    // Check connection
    if (mysqli_connect_errno())
    {
    echo "Failed to connect to MySQL: " . mysqli_connect_error();
    }
    ?>

    and for your create_admin_table.php, use the code below;
    <?php
    //connect to db

    require"connect_to_mysql.php";

    $sql = "CREATE TABLE admin (
    id int(11) NOT NULL auto_increment,
    username varchar(255) NOT NULL,
    password varchar(255) NOT NULL,
    last_log_date date NOT NULL, PRIMARY KEY (id),
    UNIQUE KEY username (username) )";

    if ($con->query($sql) === TRUE) {
    echo "Table created successfully";
    } else {
    echo "Error creating table: " . $con->error;
    }

    $con->close();

    ?>

    IT WORKS PERFECTLY !!!

  3. Hi Adam,
    I am trying to create a web page, after adding div and floating them when am trying to resize the window all divs overlaps, could you please share a tutorial how to overcome that issue. Like your website when I resize they don't overlaps I can see they are fixed where they are when the window was maximum and when I resize it the divs don't overlaps and a scroll bar appears at the browser window.

  4. @Adam Khoury your videos are amazing. Not sure if you have any info or could make a video on setting this whole thing up on a AWS EC2 Ubuntu LAMP stack instead of going through Cpanel? Would love to learn out to do that.

  5. Hi Adam Your Transaction Script For Paypal Do Not Contain Any Filed or Gathering Buyer's Phone Number From Paypal. As A part For Shipping Products Phone Number Is Really Essential Without Its In Complete.

  6. Thank you so much for your tutorials Adam Khoury…been watching from part 1 and still continuing. GOD BLESS YOU! watching all the way from KENYA, Happy coding viewers :). Cant thank you enough for how much you've made me understand php ๐Ÿ™‚

Leave a Reply