Assignment help PHP + MySQL crash course

Slides:



Advertisements
Similar presentations
LIS651 lecture 3 taming PHP Thomas Krichel
Advertisements

CHAPTER 10 COMMON PROGRAMMING TECHNIQUES. SENDING VALUES TO A SCRIPT Hidden form input type: Depending on the method, $_POST['do'] or $_GET['do'] will.
PHP Hypertext Preprocessor Information Systems 337 Prof. Harry Plantinga.
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.
Web Database Programming Connecting Database to Web.
PHP and MySQL PHP for the Web, page PHP and MySQL MySQL Resource PHP – MySQL Resource
PHP Server-side Programming. PHP  PHP stands for PHP: Hypertext Preprocessor  PHP is interpreted  PHP code is embedded into HTML code  interpreter.
Introduction to PHP and Server Side Technology. Slide 2 PHP History Created in 1995 PHP 5.0 is the current version It’s been around since 2004.
© Yanbu University College YANBU UNIVERSITY COLLEGE Management Science Department © Yanbu University College Module 6:WEB SERVER AND SERVER SIDE SCRPTING,
INFM 603: Information Technology and Organizational Context Jimmy Lin The iSchool University of Maryland Thursday, October 18, 2012 Session 7: PHP.
MySQL in PHP – Page 1 of 17CSCI 2910 – Client/Server-Side Programming CSCI 2910 Client/Server-Side Programming Topic: MySQL in PHP Reading: Williams &
MySQL + PHP.  Introduction Before you actually start building your database scripts, you must have a database to place information into and read it from.
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.
A little PHP. Enter the simple HTML code seen below.
Accessing MySQL with PHP IDIA 618 Fall 2014 Bridget M. Blodgett.
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.
Assignment help PHP + MySQL crash course Minpeng Zhu.
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.
CISC 3140 (CIS 20.2) Design & Implementation of Software Application II Instructor : M. Meyer Address: Course Page:
Creating PHPs to Insert, Update, and Delete Data CS 320.
Intro to PHP Carl-Erik Svensson. What is PHP? PHP is a widely-used general-purpose scripting language that is especially suited for Web development and.
Open Source Server Side Scripting ECA 236 Open Source Server Side Scripting PHP & MySQL.
PHP-based Authentication
ITN Wake Tech1 ITN270 Advanced Internet Databases Lecture 11. The Perl DBI API - Part II Topics: – Perl DBI interface to MySQL.
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.
Mr. Justin “JET” Turner CSCI 3000 – Fall 2015 CRN Section A – TR 9:30-10:45 CRN – Section B – TR 5:30-6:45.
Chapter 1 Introduction to PHP Part 1. Textbook’s Code DOWNLOADS PHP and MySQL for Dynamic Web Sites Complete Set of Scripts.
PHP with MYSQL Please use speaker notes for additional information!
Session 11: Cookies, Sessions ans Security iNET Academy Open Source Web Development.
DATABASE ACCESS CONTROL IST Question Almost every PHP page needs to interact with database, does that mean sqlUsername and sqlPassword need to be.
A little PHP. Enter the simple HTML code seen below.
L.A.M.P. İlker Korkmaz & Kaya Oğuz CS 350. Why cover a lecture on LAMP? ● Job Opportunities – There are many hosting companies offering LAMP as a web.
Introduction to Dynamic Web Programming
Unix System Administration
Introduction to PHP Part 1
PHP Functions Besides the built-in PHP functions, we can create our own functions. A function is a block of statements that can be used repeatedly in.
Chapter 19 PHP Part III Credits: Parts of the slides are based on slides created by textbook authors, P.J. Deitel and H. M. Deitel by Prentice Hall ©
PHP Hypertext Preprocessor
BASIC PHP and MYSQL Edward S. Flores.
Intro to PHP & Variables
PHP: Output Formatting
PHP Overview PHP: Hypertext Preprocessor Server-Side Scripting
MySQL tutorial.
Simple PHP application
HTML Forms and User Input
Assignment help PHP + MySQL crash course
Web Systems Development (CSC-215)
Web Systems Development (CSC-215)
HITS Hypertext Induced Topic Selection
Software Engineering for Internet Applications
Web DB Programming: PHP
PHP: Database Basic Selection FdSc Module 109
HITS Hypertext Induced Topic Selection
PHP: Database connection
Web Programming– UFCFB Lecture
MySQL Web Application Connecting to a MySQL database
Assignment help PHP + MySQL crash course
Database Access with PHP and MySQL
Introduction to PHP.
PHP Programming Using Cloud 9 IDE.
PHP By Prof. B.A.Khivsara Note: The material to prepare this presentation has been taken from internet and are generated only for students reference and.
Presentation transcript:

Assignment help PHP + MySQL crash course 11/20/2018 Assignment help PHP + MySQL crash course Gyozo Gidofalvi

Assignment Implement a movie database with a web front-end using the Linux-Apache-MySQL-PHP, or LAMP, Web development framework To be completed in groups (3-5) Deploy solution See me in the lab to get a MySQL account for your group Demo your solution during the scheduled labs 11/20/2018 Gyozo Gidofalvi

Connecting to MySQL from PHP <? $link = mysql_connect($hostname, $username, $password) or die("Could not open connection to database"); ?> Now the variable $link contains the information for your connection to MySQL. You can disconnect using: mysql_close($link) or die("Could not close connection to database"); 11/20/2018 Gyozo Gidofalvi

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. <? mysql_select_db(“ecomXXXX", $link) or die("Could not select database"); $result = mysql_query("select * from some_table") or die("Could not issue MySQL query"); ?> Now the variable $result will be used to reference the query we just made. 11/20/2018 Gyozo Gidofalvi

Array handling in PHP In PHP, arrays are associative. Any number or string can be used to index an array. <? $array["hello"] = 3; $array[5] = "how are you?"; while (list($column, $value) = each($array)) { print("$column = $value\n"); } reset($array); ?> This example would print: hello = 3 5 = how are you? The command reset($array) puts the array iterator back to the beginning of the array. 11/20/2018 Gyozo Gidofalvi

Getting the results from a query After issuing a query, you retrieve the results using the variable $result. <? if (mysql_num_rows($result) == 0) { print("No results matching your query<BR>\n"); } else { print("Here are the results:<BR>\n"); while ($row = mysql_fetch_row($result)) { while (list($colname, $value) = each($row)) { print("$value "); } print("<BR>\n"); ?> 11/20/2018 Gyozo Gidofalvi

HTML forms and PHP variables From an HTML page that had this form: <FORM ACTION="target.php" METHOD="GET"> <INPUT TYPE="TEXT" NAME="myvar"> <INPUT TYPE="TEXT" NAME="yourvar"> <INPUT TYPE="SUBMIT" NAME="submit"> </FORM> The PHP script (target.php) will receive the variables from the form by the same name: <? print("you entered myvar = $_GET[myvar], yourvar = $_GET[yourvar]\n"); ?> 11/20/2018 Gyozo Gidofalvi

Useful string stuff in PHP Difference between single and double quotes: <? $name = "Joe"; print("hello, your name is $name\n"); print(‘hello, your name is $name\n’); ?> Output: hello, your name is Joe hello, your name is $name $trimmed = trim(" this string has whitespace "); removes leading and trailing whitespace $encoded = urlencode("this is a non-encoded url string"); changes the argument so that it will be part of a valid URL 11/20/2018 Gyozo Gidofalvi