<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[CS310 Assignment 3 Solution and Discussion]]></title><description><![CDATA[<p dir="auto">Assignment No. 03<br />
Semester: Fall 2019<br />
CS310: Open Source Web Application Development	Total Marks: 20<br />
Due Date: January 15, 2020<br />
Topics Covered: Topics of Week 6 to 10</p>
<p dir="auto">General Instructions:</p>
<p dir="auto">Please read the following instructions carefully before submitting assignment. It should be clear that your assignment will not get any credit if:</p>
<p dir="auto">	The assignment is submitted after due date.<br />
	The submitted assignment does not open or file is corrupt.<br />
	Assignment is copied (partial or full) from any source (websites, forums, students, etc.)</p>
<p dir="auto">Note: You have to upload your assignment solution only in .doc or .docx format only. File submitted other than Microsoft Word format will get zero marks.</p>
<p dir="auto">Objective:</p>
<p dir="auto">The objective of this assignment is to provide hands on experience of:</p>
<p dir="auto">•	Installing and configuring MySQL<br />
•	Database and table creation<br />
•	Inserting data into database (tables)</p>
<p dir="auto">Tools to use:</p>
<ul>
<li>
<p dir="auto">XAMP / WAMP / Vertrigo server</p>
<p dir="auto">For any query about the assignment, contact at <a href="mailto:cs310@vu.edu.pk" target="_blank" rel="noopener noreferrer nofollow ugc">cs310@vu.edu.pk</a></p>
</li>
</ul>
<p dir="auto">Problem Statement:<br />
Suppose you are working as a web developer in a financial institute. A task is given to you is take the data of sale and save into a table into a database.<br />
Table Structure:</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Column Name</th>
<th>Data Type</th>
</tr>
</thead>
<tbody>
<tr>
<td>Id</td>
<td>Numeric</td>
</tr>
<tr>
<td>Name</td>
<td>Text</td>
</tr>
<tr>
<td>Region</td>
<td>Text</td>
</tr>
<tr>
<td>ClientName</td>
<td>Text</td>
</tr>
<tr>
<td>Units</td>
<td>Numeric</td>
</tr>
<tr>
<td>UnitCost</td>
<td>Decimal</td>
</tr>
<tr>
<td>Date</td>
<td>Date</td>
</tr>
</tbody>
</table>
<p dir="auto">Sample Data:</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>ID</th>
<th>Name</th>
<th>Region</th>
<th>ClientName</th>
<th>Units</th>
<th>UnitCost</th>
<th>Date</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Pencil</td>
<td>East</td>
<td>Jones</td>
<td>95</td>
<td>1.99</td>
<td>01/06/2018</td>
</tr>
<tr>
<td>2</td>
<td>Binder</td>
<td>Central</td>
<td>Kivell</td>
<td>50</td>
<td>19.99</td>
<td>1/23/2018</td>
</tr>
<tr>
<td>3</td>
<td>Pencil</td>
<td>Central</td>
<td>Jardine</td>
<td>36</td>
<td>4.99</td>
<td>02/09/2018</td>
</tr>
<tr>
<td>4</td>
<td>Pen</td>
<td>Central</td>
<td>Gill</td>
<td>27</td>
<td>19.99</td>
<td>2/26/2018</td>
</tr>
<tr>
<td>5</td>
<td>Pencil</td>
<td>West</td>
<td>Sorvino</td>
<td>56</td>
<td>2.99</td>
<td>3/15/2018</td>
</tr>
<tr>
<td>6</td>
<td>Binder</td>
<td>East</td>
<td>Jones</td>
<td>60</td>
<td>4.99</td>
<td>04/01/2018</td>
</tr>
<tr>
<td>7</td>
<td>Pencil</td>
<td>Central</td>
<td>Andrews</td>
<td>75</td>
<td>1.99</td>
<td>4/18/2018</td>
</tr>
<tr>
<td>8</td>
<td>Pencil</td>
<td>Central</td>
<td>Jardine</td>
<td>90</td>
<td>4.99</td>
<td>05/05/2018</td>
</tr>
<tr>
<td>9</td>
<td>Pencil</td>
<td>West</td>
<td>Thompson</td>
<td>32</td>
<td>1.99</td>
<td>5/22/2018</td>
</tr>
<tr>
<td>10</td>
<td>Binder</td>
<td>East</td>
<td>Jones</td>
<td>60</td>
<td>8.99</td>
<td>06/08/2018</td>
</tr>
</tbody>
</table>
<p dir="auto">Solution Instructions:<br />
To solve this assignment, you need to perform following steps with the help of PHP code.<br />
•	Connect to MySQL server.<br />
•	Create a database, the name of database should be your VU-ID.<br />
•	Create table “Sales” into database. Structure of table is given above.<br />
•	Insert sample data into “Sales” table. Sample data is given above.<br />
•	Take screen shot of data base from MySQL and paste into solution file.</p>
<p dir="auto">What you have to submit?<br />
You have to copy/paste following into your solution file then upload solution file from your LMS account.<br />
•	PHP code which will create database, table and save sample database into table.<br />
•	Screen shot of “Sales” table from MySql using phpMyAdmin tool.</p>
<p dir="auto">Best of Luck!</p>
]]></description><link>https://community.secnto.com//topic/988/cs310-assignment-3-solution-and-discussion</link><generator>RSS for Node</generator><lastBuildDate>Mon, 08 Jun 2026 20:45:50 GMT</lastBuildDate><atom:link href="https://community.secnto.com//topic/988.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 15 Jan 2020 09:00:50 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to CS310 Assignment 3 Solution and Discussion on Wed, 15 Jan 2020 09:07:41 GMT]]></title><description><![CDATA[<p dir="auto">Solution Idea!<br />
php file<br />
CS301.php</p>
<pre><code>&lt;?php
$host = "localhost";
$user = "root";
$password = "";
$dbname = "bc12345";

// Create connection
$conn = mysqli_connect($host, $user, $password, $dbname);
// Check connection
if (!$conn) {
    die("Connection failed: " . mysqli_connect_error());
}

$sql = "INSERT INTO `sales` (`ID`, `Name`, `Region`, `Client_Name`, `Unit`, `Unit_Cost`, `Date`) 
VALUES ('5', 'boll point', 'south', 'Jhon', '230', '120.99', '2020-01-12')";

if (mysqli_query($conn, $sql)) {
    echo "New record created successfully";
} else {
    echo "Error: " . $sql . "&lt;br&gt;" . mysqli_error($conn);
}

mysqli_close($conn);
?&gt;
&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;CS310 Assignment&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;


&lt;/body&gt;
&lt;/html&gt;
</code></pre>
]]></description><link>https://community.secnto.com//post/2707</link><guid isPermaLink="true">https://community.secnto.com//post/2707</guid><dc:creator><![CDATA[zareen]]></dc:creator><pubDate>Wed, 15 Jan 2020 09:07:41 GMT</pubDate></item><item><title><![CDATA[Reply to CS310 Assignment 3 Solution and Discussion on Wed, 15 Jan 2020 09:04:34 GMT]]></title><description><![CDATA[<p dir="auto"><a href="https://youtu.be/Kn_9qChNE7A" target="_blank" rel="noopener noreferrer nofollow ugc">https://youtu.be/Kn_9qChNE7A</a></p>
]]></description><link>https://community.secnto.com//post/2706</link><guid isPermaLink="true">https://community.secnto.com//post/2706</guid><dc:creator><![CDATA[zareen]]></dc:creator><pubDate>Wed, 15 Jan 2020 09:04:34 GMT</pubDate></item></channel></rss>