Instructions
Using Php and MySQL, database from Xampp
In this assignment, you will create an application using PHP and MySQL, incorporating all of the skills that you have learned throughout the course.
As you complete the project, be sure that you are using the correct format and syntax as well as the appropriate structure for your coding.
To move forward to the next module, you will need to demonstrate mastery by scoring an 80% or higher. If you score less than 80%, your instructor will provide you will feedback and additional resources so that you may adjust and resubmit your project.
Project Instructions
The last Chapter in our text book is titled “Putting It All Together”, this is where we create the complete Application. This last project requires you to create an application which will include the following elements:
Connect to the Database:
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "databasename";
// Create connection
$conn = mysqli_connect($servername, $username,
$password, $dbname);
if (!$conn) {
die("Connection failed: " .
mysqli_connect_error());
}
?>
Inserts data into the Database:
<?php
$conn = mysqli_connect($servername,
$username, $password, $dbname);
if (!$conn) {
die("Connection failed: " .
mysqli_connect_error());
}
$sql="insert query'"; //ex: insert into user
values('userid','username','age')
$result=mysqli_query($conn,$sql);
if ($result) {
echo "row inserted
successfully";
}
}else{
echo "error while inserting
row";
}
?>
Retrieves data in the Database:
<?php
$conn = mysqli_connect($servername,
$username, $password, $dbname);
if (!$conn) {
die("Connection failed: " .
mysqli_connect_error());
}
$sql="select query'"; //select *from
user
$result=mysqli_query($conn,$sql);
if (mysqli_num_rows($result) > 0) {
while($row=mysqli_fetch_assoc($result)){
echo "$row['column1_name']";
echo "$row['column2_name']";
//...................
}
}else{
echo "no rows found";
}
?>
Deletes data from the Database:
<?php
$conn = mysqli_connect($servername,
$username, $password, $dbname);
if (!$conn) {
die("Connection failed: " .
mysqli_connect_error());
}
$sql="delete query'"; //ex: delete from user
where userid='HomeworkLib'
$result=mysqli_query($conn,$sql);
if ($result) {
echo "row deleted
successfully";
}
}else{
echo "error while deleting
row";
}
?>
Updates data in the Database:
<?php
$conn = mysqli_connect($servername,
$username, $password, $dbname);
if (!$conn) {
die("Connection failed: " .
mysqli_connect_error());
}
$sql="update query'"; //ex: update user set
username='HomeworkLibstudy' where userid='HomeworkLib'
$result=mysqli_query($conn,$sql);
if ($result) {
echo "row updated
successfully";
}
}else{
echo "error while updating
row";
}
?>
Instructions Using Php and MySQL, database from Xampp In this assignment, you will create an application...
MySQL 8 Create a PHP program that will read in each table of the database you created in Assignment 8 and display the values into a good looking table. When I run it, I'm having this error " Parse error: syntax error, unexpected '$dbName' (T_VARIABLE) in C:\xampp\htdocs\assignment9\includes\dbh.inc.php on line 6' Here is my index.php <?php include_once 'includes/dbh.inc.php'; ?> <!DOCTYPE html> <html> <head> <title></title> </head> <body> <?php $sql = "SELECT * FROM comic_book.books;"; $result = mysqli_query($conn, $sql);...
Create web pages for your database using PHP. You should have one page that will return all the information from the database. You should create additional pages that will allow you to do various queries of your database. You should be able to retrieve and insert data; also include functionality to delete data from your database. Create an html form that will allow you to enter in new information for the database. The information should be handled by a PHP...
Using PHP and MYSQL create a form that: user Full name user Comment (as many lines as they want) allows the user to attach one image uploads the Full name, comment, and image to a database Displays the user's full name, comment and user image on the website by selecting them from the database. Include the server connection file as well any necessary codes to connect and maintain the database
Create a MySQL Database called “CSC306Class”. Create three (3) tables in the database called “studentInf”, “IntructorInf”, and “LikedAndDisliked”. Each table should consist of five columns that are relatable to the table name. Insert at least five row of data in each table. The data can be any information as long as it is related to the table name. Upload the codes to complete the above for grading. Extra Credit: If you were able to download and setup an php server...
PHP Programming In this project, you will create a Web page that allows visitors to your site to sign a guest book that is saved to a database. Create a new document in your text editor and type the <!DOCTYPE> declaration, <html> element, document head, and <body> element. Use the strict DTD and “Guest Book” as the content of the <title> element. Add the following text and elements to the document body: <h2>Enter your name to sign our guest book</h2>...
Write a PHP script that obtains a URL and its description from user and stores the information into a database using MySQL. Create and run a SQL script with database named URL and a table named Urltable. The first field of the table should contain an actual URL, and the second, which is named Description, should contain a description of the URL. Use www.deitel.com as the first URL, and input Cool site! as its description. The second URL should be...
Using the MySQL Workbench create a new database using your design specifications Add at least 10 records to your tables. Note: Certain tables may not require 10 records and that is ok as long as your main tables have 10 or more Create MySQL statements that will retrieve all records or rows from the tables in your database Create 10 MySQL statements that will retrieve specified records or rows from one table in your database Create 10 MySQL statements that...
You need to implement a web application that is split in three parts, namely, Webpage, PHP and MySQL. Each of them will be used accordingly to solve a simple problem described below. Remember to implement the logic in the most secure way of your knowledge. PHP Implement a PHP function that reads in input a string from the user and store it in a table (e.g., in a field called "Content Name"). The function should be able to read the...
Using MySQL and PHP keep it simple This assignment you will be making a form that will do one of three things in a database - It will add a record - It will update a record - It will search for a record Your database will contain a table for keeping a record of all your friends and family and should contain: First name Last name Phone number Address City State Zip Birthdate Username Password The sex of the...
Using PHP and MySQL, create a Web page to be used for storing software development bug reports in a MySQL database. Include fields such as product name and version, type of hardware, operating system, frequency of occurrence, and proposed solutions. Include links on the main page that allow you to create a new bug report and update an existing bug report. I have tried the various solutions provided previously for this exercise, but it does not work because every author...