Assignment help PHP + MySQL crash course Minpeng Zhu.

Slides:



Advertisements
Similar presentations
PHP SQL. Connection code:- mysql_connect("server", "username", "password"); Connect to the Database Server with the authorised user and password. Eg $connect.
Advertisements

Widhy Hayuhardhika NP, S.Kom. Overview of database structure Connecting to MySQL database Selecting the database to use Using the require_once statement.
PHP and MySQL Database. Connecting to MySQL Note: you need to make sure that you have MySQL software properly installed on your computer before you attempt.
Website Development Working with Databases. What you will achieve today! Connecting to mySql Creating tables in mySql Saving data on a server using mySql.
PHP and MySQL PHP for the Web, page PHP and MySQL MySQL Resource PHP – MySQL Resource
Website Development Working with Databases. What you will achieve today! Connecting to mySql Creating tables in mySql Saving data on a server using mySql.
PHP on a Fast Track a quick introduction to PHP programming by Jarek Francik.
1 CS428 Web Engineering Lecture 23 MySQL Basics (PHP - VI)
SJSU CS157B Dr. Lee1  2004 Jenny Mitchell Two Useful Tools You Can’t Live Without by Jenny Mitchell SJSU CS157B Section PHP and MySQL.
Lecture 3 – Data Storage with XML+AJAX and MySQL+socket.io
Deleting and Updating Records in MySQL using PHP Basharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan. 1.
© Yanbu University College YANBU UNIVERSITY COLLEGE Management Science Department © Yanbu University College Module 6:WEB SERVER AND SERVER SIDE SCRPTING,
1Computer Sciences Department Princess Nourah bint Abdulrahman University.
Application Sketch home.htm delete.php updateform.php display.php insert.php insertform.htm update.php Data Base Hyperlink Information exchange with database.
MySQL in PHP – Page 1 of 17CSCI 2910 – Client/Server-Side Programming CSCI 2910 Client/Server-Side Programming Topic: MySQL in PHP Reading: Williams &
Create an online booking system (login/registration)
Microsoft Azure Introduction ISYS 512. Microsoft Azure Microsoft Azure is a cloud.
Nic Shulver, Retrieving Stored Data Introduction This set of slides shows: The information source database structure The data.
PHP – MySQL Extensions. Table used in most examples CREATE TABLE product ( rowID INT NOT NULL AUTO_INCREMENT, productid VARCHAR(8) NOT NULL, name VARCHAR(25)
1 PHP and MySQL. 2 Topics  Querying Data with PHP  User-Driven Querying  Writing Data with PHP and MySQL PHP and MySQL.
NMED 3850 A Advanced Online Design January 26, 2010 V. Mahadevan.
Ways to manage DB in MySQL cs346. Six ways to CREATE and INSERT INTO tables Modelocalremotelocalremotewindow WhereMysql console Putty; Mysql console Mysql.
_______________________________________________________________________________________________________________ PHP Bible, 2 nd Edition1  Wiley and the.
PHP MySQL Introduction. MySQL is the most popular open-source database system. What is MySQL? MySQL is a database. The data in MySQL is stored in database.
MySQL and PHP 3 March 2006 Adina Crainiceanu IT420: Database Management and Organization.
PHP MySQL. SQL: Tables CREATE TABLE tablename { fieldname type(length) extra info,... } Extra info: –NULL (allows nulls in this field) –Not NULL (null.
Creating Dynamic Web Pages Using PHP and MySQL CS 320.
School of Computing and Information Systems CS 371 Web Application Programming PHP – Forms, Cookies, Sessions and Database.
Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy.
MySQL Databases & PHP Integration Using PHP to write data to, and retrieve data from, a MySQL database.
1. Connecting database from PHP 2. Sending query 3. Fetching data 4. Persistent connections 5. Best practices.
Lecture 10 – MYSQL and PHP (Part 2)
Accessing Your MySQL Database from the Web with PHP (Ch 11) 1.
Database Access with PHP and MySQL CS356 Examples from Web Database Applications, by Hugh E. Williams & David Lane, O'Reilly, 2002.
PHP with MySQL 1.
PHP+MySQL Integration. Connecting to databases One of the most common tasks when working with dynamic webpages is connecting to a database which holds.
PHP - MySQL Connection 8 March 2006 Adina Crainiceanu IT420: Database Management and Organization.
HTML, PHP, and MySQL: Putting It All Together. Making a Form Input tags Types: “text” “radio” “checkboxes” “submit”
CISC 3140 (CIS 20.2) Design & Implementation of Software Application II Instructor : M. Meyer Address: Course Page:
Retrieving data from MySQL using PHP Basharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan. 1.
PHP Database connectivity Connecting with RDBMS and editing, adding, and deleting databases therein are all done through PHP functions.
THE WEBMASTERS: SENG + WAVERING.  On account of construction, we will be having class in room 1248 next week.
CS453: Databases and State in Web Applications (Part 2) Prof. Tom Horton.
Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy.
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.
NMD202 Web Scripting Week5. What we will cover today PHP & MySQL Displaying Dynamic Pages Exercises Modifying Data PHP Exercises Assignment 1.
Creating a simple database This shows you how to set up a database using PHPMyAdmin (installed with WAMP)
MySQL. Is a SQL (Structured Query Language) database server. Can be accessed using PHP with embedded SQL Queries Supports Large DB’s, 60,000 tables with.
Accessing mySQL relational database. MySQL database.  Today, we will attempt and open a connection to the MySQL server.  We need to specify the database.
Server-Side Solutions Steve Perry
IS2803 Developing Multimedia Applications for Business (Part 2) Lecture 1: Introduction to IS2803 Rob Gleasure
Mr. Justin “JET” Turner CSCI 3000 – Fall 2015 CRN Section A – TR 9:30-10:45 CRN – Section B – TR 5:30-6:45.
MySQL MySQL and PHP – interacting with a database.
PHP with MYSQL Please use speaker notes for additional information!
Programming for the Web MySQL Command Line Using PHP with MySQL Dónal Mulligan BSc MA
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
Unix System Administration
Website Development Basics with PHP MySQL
PHP: Output Formatting
MySQL tutorial.
Assignment help PHP + MySQL crash course
Assignment help PHP + MySQL crash course
MySQL Web Application Connecting to a MySQL database
Accessing Your MySQL Database from the Web with PHP (Ch 11)
PHP: Database Basic Selection FdSc Module 109
PHP: Database connection
Web Programming– UFCFB Lecture
MySQL Web Application Connecting to a MySQL database
Assignment help PHP + MySQL crash course
Conection
Presentation transcript:

Assignment help PHP + MySQL crash course Minpeng Zhu

Minpeng Zhu2 Assignment  Implement a web application for movie management with a movie database as data storage and a web front-end using the Linux- Apache-MySQL-PHP (LAMP) web development framework  To be completed in groups (3-5)  Deploy solution See TA in the lab to get a MySQL account for your group  Demo your solution during the scheduled labs or send solution (URL + source) by to TA by

Minpeng Zhu3 Connecting to MySQL from PHP <?php $hostname = "linne.it.uu.se"; $username = "…"; $password = "…"; $connection = mysql_connect($hostname, $username, $password) or die("Could not open connection to database"); ?>  Now the variable $connection contains the information for your connection to MySQL. You can disconnect using: <?php mysql_close($connection) or die("Could not close connection to database"); ?>

Minpeng Zhu4 Select a database, issue queries  Once you have connected successfully, you should select the database you will use. Then you can issue queries to the database. <?php mysql_select_db("your DB name", $connection) or die("Could not select database"); $result = mysql_query("select * from some_table"); // No ; at the end or die("Could not issue MySQL query"); ?>  Now the variable $result holds the query resultset.

Minpeng Zhu5 Table of books  We have the following table of books, called books :  How can we access this table from PHP? book_namepublish_yearpricerating Rädd att flyga SCUM Manifesto

Minpeng Zhu6 Printing the results from a query After issuing a query, you retrieve the results using the variable $result. Retrieve one row at a time using mysql_fetch_assoc($result). <?php $result = mysql_query("select book_name, publish_year from books"); if (mysql_num_rows($result) == 0) { print("No results matching your query \n"); } else { print("The Books: \n"); while ($row = mysql_fetch_assoc($result)) { $book_name = $row["book_name"]; $publish_year = $row["publish_year"]; print("Book name: $book_name, Publish year: $publish_year\n"); } ?>

Minpeng Zhu7 HTML forms and PHP variables  Create a HTML form:  Then, in add_book.php, access the submitted values: <?php $book_name = $_POST["book_name"]; $publish_year = $_POST["publish_year"]; print("You entered $book_name and $publish_year"); ?>

Drop down list  Given the following table of book categories, called category  Create drop down list <?php $result = mysql_query("select id, name from category"); while($row = mysql_fetch_assoc($result)) { $id = $row["id"]; $name = $row["name"]; print(" $name \n"); } ?>  Selected value available in $_POST["category"] Minpeng Zhu8 idname 1Sci-Fi 2Poesi

Minpeng Zhu9 Useful links  PHP -  MySQL using PHP -  NetBeans PHP IDE -  PHP+MySQL Tutorial -  Website development -  Apache+MySQL+PHP on Windows (WAMP) -