Creating A Database Driven Website 1.Setting Up Your Web Server 2.Creating a Database 3.Creating a Webpage to Display Information From a Database 4.Creating a form to Add information to a Database 5.Registering a Domain Name 6.Associating a Domain Name to Your Server
Visit to setup a free websitehttp://domainsforauthors.com/
Your URL:
Cpanel URL:
Title descriptive of the page's contents or purpose Your content goes here
Cpanel URL:
CREATE TABLE IF NOT EXISTS `students` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(100) NOT NULL, ` ` varchar(100) NOT NULL, `url` varchar(100) NOT NULL, `added` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`), KEY `name` (`name`), KEY `id` (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=128 ; INSERT INTO `students` (`id`, `name`, ` `, `url`, `added`) VALUES (2, 'Ira Cross', '', ' :39:55'), (3, 'Anna Rios', ' ' :43:00'), (4, 'Troy Johnson', ' ' :01:54'), (5, 'Wonder Woman', ' ' :50:28'), (1, 'Junjie Low', '', ' :44:18');
<?php $servername = "sql305.domainsforauthors.com"; $username = "dmnsf_ "; $password = "your_password"; $dbname = "dmnsf_ _database"; ?> Create new a file call it database-connect.php
Create a new file called students.php Student Demo Page Student Demo Page <?php include('database-connect.php'); // Create connection $conn = new mysqli($servername, $username, $password, $dbname); // Check connection if ($conn->connect_error) { die("Connection failed: ". $conn->connect_error); } $sql = "SELECT id,name, ,url,added FROM students"; $result = $conn->query($sql); if ($result->num_rows > 0) { // output data of each row while($row = $result->fetch_assoc()) { echo $row["id"]. $row["name"]. $row["website"]. " "; } } else { echo "0 results"; } $conn->close(); ?>
Create a php file called add-student.php You may download the HTML here:
Registering a Domain Name
You will be presented with multiple screens attempting to up sell you on with multiple, typically unneeded products. Registering 2 domain names cost $19.98 via Network Solutions
Remember, you need to change the nameservers on a domain via registrar control panel BEFORE adding it to your account, it may take 24 to 72 hours to completely update the nameservers (it usually does not take that long): Please verify your nameservers and/or change them to: ns1.byet.org ns2.byet.org ns3.byet.org ns4.byet.org ns5.byet.org The nameservers are changed via your domain registrar [in our case Network Solutions] control panel, NOT your hosting control panel [in our case domainsforauthors.com]. With free domainsforauthors account name servers MUST be set first, before adding the domain here in control panel.
After ___ hours now pointa to the web site hosted at domainforauthors.comhttp://studentdemo.org For SEO reasons previously discussed you should stop using the original URL in this case Use Stop using
Insert screen shot of classdemo.org