UNIT V ESTABLISHING A DATABASE CONNECTION AND WORKING WITH DATABASE

Size: px
Start display at page:

Download "UNIT V ESTABLISHING A DATABASE CONNECTION AND WORKING WITH DATABASE"

Transcription

1 UNIT V 1 ESTABLISHING A DATABASE CONNECTION AND WORKING WITH DATABASE

2 SYLLABUS 5.1 Overview of Database 5.2 Introduction to MYSQL 5.3 Creating Database using phpmyadmin & Console(using query, using Wamp server) 5.4 Connecting with PHP/ Database Connection, creating and executing queries using mysql_query() 5.5 Creating tables, inserting data in to table, inserting data through HTML Forms 2

3 5.6 Retrieving data from Table, using mysql_numrows(), Printing the output using PHP and HTML 5.7 Searching a record, displaying record fields in HTML form controls, Updating and deleting records 5.8 Hosting Website (Using C panel, Using Filezilla Software) 5.9 Working on mini PHP Project: Developing a sample web based application and hosting it 3

4 5.1 OVERVIEW OF DATABASE Database: A database is simply an organized collection of related data, typically stored on disk, and accessible by possibly many concurrent users. Databases are generally separated into application areas. For example, one database may contain Human Resource (employee and payroll) data; another may contain sales data; another may contain accounting data; and so on. Databases are managed by a DBMS. DBMS A Database Management System (DBMS) is a set of programs that manages any number of databases. 4

5 5.2 INTRODUCTION TO MYSQL MySQL is a database system used on the web MySQL is a database system that runs on a server MySQL is ideal for both small and large applications MySQL is very fast, reliable, and easy to use MySQL uses standard SQL MySQL compiles on a number of platforms MySQL is free to download and use MySQL is developed, distributed, and supported by Oracle Corporation 5

6 MYSQL STRUCTURE AND SYNTAX : My SQL is a relational database management system. In Relation Database Management system every database consists of one of more tables inside it/ Thus you can say that a Database is a collection of one or more then one tables which are related with each other in one or another way. A table in the Database is used to store records. The records in the table are organized in the form of rows. Each row in the table represents particular record. A record that is contained in the table is a collection of one or more columns. Each column in the record represents field of specific type in the database table. Each field in the record contains values for the different records. 6

7 Thus you can say that a Database is a collection of tables. Tables is a collection of records and record is a collection of fields as shown below : Database : College Information System Table 1 : Department_Master Field 1 Field 2 DepartmentCode DepartmentName 1 Computer 2 Mechanical 3 Electrical Record 1 Record 2 7 Record 3

8 Table 2 : Faculty_Master Field 1 Field 2 Field 3 FacultyCode DepartmentCode FacultyName 1 1 Patel Chandresh 2 2 Purani Mukesh 3 3 Shah Ghanshyam Record 1 Record 2 Record 3 In the above figure Database College Information system consist of two tables named Department_Master and Faculty_Master. Both tables having one common field DepartmentCode inside it which means both tables are related with each other. 8

9 Data Type of MySQL :MySQL Data Types are divided into three main categories as given below : (1) Numeric DataType (2) String or Text DataType (3) Date Time Data Type Numeric DataType : Sr.No Data Type Size 1 TINYINT 1 It is used to store integer values. 2 SMALLINT 2 It is used to store integer values. 3 MEDIUMINT 3 It is used to store integer values. 4 INT 4 It is used to store integer values. 5 BIGINT 8 It is used to store integer values. 6 FLOAT 4 It is used to store single precision floating point value. 7 DOUBLE 8 It is used to store double precision floating point value. 8 DECIMAL It is used to store integer values. 9

10 String or Text Data Type : Sr.No Data Type SIZE 1 CHAR 255 It is used to store fixed length string. 2 VARCHAR 255 It is used to store variable length string. 3 TINYBLOB 255 It is used to store short binary data. 4 TINYTEXT 255 It is used to store short text string. 5 BLOB It is used to store large binary data. 6 TEXT It is used to store large text string. 7 MEDIUMBLOB It is used to store medium binary data. 8 MEDIUMTEXT It is used to store medium text string. 9 LONGBLOB It is used to store extremely large binary data. 10 LONGTEXT It is used to store extremely large text string. 10

11 Data Time Data Type : Sr. No Data Type SIZE 1 DATE 3 It is used to store date values in the YYYY MM DD Format. 2 TIME 3 It is used to store time values or time duration in the HH : MM : SS format. 3 YEAR 1 It is used to year values in the YYYY format. 4 DATETIME 8 It is used to store Date and Time value in the YYYY MM DD HH : MM : SS format. 5 TIMESTAMP 9 It is used to store combined date and time value in the YYYYMMDDHHMMSS format. 11

12 FIELD MODIFIER IN MYSQL : (1) NULL or NOT NULL : It allows you to specify weather the field can accept null value or you must have to enter value for that field. You can specify this modifier at the end field definition. By default all the filed of the table having this modifier set to NULL 12

13 Example : CREATE TABLE Subject ( SubjectCode varchar (5) NOT NULL, SubjectName varchar (10) NOT NULL, SubDesc varchar (20) NULL ) (2) DEFAULT : Default modifier allows you to specify default value for the field so if you don t enter any value for that field then default value is used. 13

14 Example : CREATE TABLE Subject ( SubjectCode varchar (5) NOT NULL, SubjectName varchar (10) NOT NULL, SubDesc varchar (20) DEFAULT Computer ) 14

15 (3) AUTO_INCREMENT : This modifier automatically increments the value of field by one. There is no need to insert explicit value for this field. It is widely used in primary key field where unique id is generated automatically by MySQL each time by incrementing previous by 1. However you can specify AUTO_INCREMENT modifier for only INT data type. Example : CREATE TABLE Subject ( SubjectCode INT(5) AUTO_INCREMENT, SubjectName varchar (10) NOT NULL, SubDesc varchar (20) NULL, 15 )

16 PHP OPERATORS Operators are used to perform operations on variables and values. PHP divides the operators in the following groups: Arithmetic operators Bitwise operators Comparison operators Logical operators 16

17 ARITHMETIC OPERATORS 17

18 COMPARISON OPERATORS 18

19 LOGICAL OPERATOR 19

20 BITWISE OPERATORS 20

21 Types of MySQL tables and storages engines : When you create table using Create Table statement it is also possible to specify type of the table using TYPE attribute as shown below : CREATE TABLE TableName ( ColumnName DataType, ColumnName DataType ) TYPE = TableType Following are the various Types of MySQL tables that you can specify at the time of creating new Database Table. 1. MyISAM 2. ISAM 3. HEAP InnoDB 5. BDB

22 LETS UNDERSTAND ALL THE TABLE TYPES IN DETAIL : 1. MyISAM : White creating Table if you don t specify the type of the Database Table then by default its type is set to MYISAM This table is portable. Portable means the table created using this type in one OS can also be used in other OS. It supports large table file more then 4GB. It is well suited for faster access then speed. It allows you to reduce the space using compression. It allows you to specify index on BLOB as well as TEXT type. 22

23 2. ISAM : This Table Type is similar to the MyISAM table type in the way it also supports fixed size as well as dynamic size table. But it is different from MYISAM table type in following way : It can support table files up to 4GB but not grater then 4GB. It is not portable. Means table created using this type in one OS can not use in other OS. It does not allow faster accessing and compression. Since maximum key length in this table type is 256 it does not allows you to specify index on BLOB and TEXT type. 23

24 3. HEAP : This table type is widely used for temporary tables because it supports incredible speed. It is in-memory table which uses hashed indices. It does not allow BLOB and TEXT type as MYISAM and ISAM type. 4. BDB : BDB is also known as Berkeley DB. This table type is transaction safe and widely used for transaction. It supports very large applications with more then one users trying to insert and update the same data at the same time. It allows you the facility of transaction using commit and rollback statement. 24

25 One important facility provided by this table type is that allows you the facility of recover data from crashes. It is not portable because the path of the table is hardwired into the table file while creating the table. 5. InnoDB : This table type is also transaction safe. It supports very large applications with more then one users trying to insert and update the same data at the same with locking mechanism. Locking mechanism prevents users from modifying records while another user is modifying the same record at the same time. It also allows you the facility of recovering data from crashes. 25 This table type is portable.

26 6. MERGE : This table type is useful for virtual table. This table type can be created by joining more then one MyISAM table types into single table. However you can join more then one MyISAM table if and only if all the table having same structure. MySQL Commands : MySQL Commands are divided into three different categories as per their functionality. 1. Database Definition Language (DDL): DDL contains commands that are used to define database or tables, define or alter structure or table, define relationship among various tables in the database, 26 drop database or tables.

27 DDL commands : Sr. No Command Purpose 1 CREATE DATABASE This command allows you to create new database. 2 USE This command allows you to create select database. 3 DROP DATABASE This command allows you to create delete database. 4 CREATE TABLE This command allows you to create new table in the selected Database. 5 ALTER TABLE This command allows you to modify the structure of the table. 6 DROP TABLE This command allows you to delete table from the database. 7 SHOW DATABASES This command allows you to display list of databases available in the server. 8 SHOW TABLES This command allows you to display list of tables available in the selected Database. 27

28 2.Database Manipulation Language (DML) : DML contains commands that are used to retrieve records from the table, insert new record into table, update records into table, and delete record from the table. DML commands : Sr. No Command Purpose 1 SELECT This command allows you to retrieve record from the table. You can specify various conditions with this command to retrieve specific records. 2 INSERT This command allows you to insert new record into table. 3 UPDATE This command allows you to update existing record. You can also specify condition with this command. 4 DELETE This command allows you to delete records from the table. You can also specify condition with this command. 28

29 3.Database Control Language (DCL): DCL contains commands that are used to define the various types of privileges on Database or tables. DCL commands : Sr. No Command Purpose 1 GRANT This command allows you to set or reset access privileges o the user for specific operations. 2 REVOKE Integration of PHP with MySQL: It is possible to execute various commands of MySQL from PHP application. PHP provides various built in functions that allow you to use MySQL commands from PHP page. Thus you can integrate PHP with 29 MySQL.

30 Sr. No Function Name Purpose 1 mysql_connect Using this function you an establish connection with MySQL. Server and connect with MySQL Server. 2 mysql_selectdb Using this function you can select the database from the MySQL Server on which you want to perform various operation. 3 mysql_query Using this function you can specify the command to be excecuted. 4 mysql_fetch_row Using this function you can retrieve single row from the result set. 5 mysql_fetch_array Using this function you can retrieve one or more rows from the result set. 6 mysql_num_rows Using this function you can display error message that is returned from MySQL. Server while executing the command. 7 mysql_rows Using this function you can retrieve number of records returned by executing the command. 8 mysql_close Using this function you can close the connection that 30 is established using mysql_connect function.

31 PHP built in functions 1. mysql_connect ( ) : This function allows you to establish connection of PHP application with MySQL server. Syntax : $VariableName = mysql_connect (servername, UserName, Password) ServerName : Indicates the name of the MySQL server with which you want to establish connection. UserName : Indicates name of the user using which you can logs on to MySQL server. Password : Indicates password of the user using 31 which you can logs on to MySQL Server.

32 This Function returns a Boolean value TRUE or FALSE. If connection establish successfully with MySQL Server then this function returns true value otherwise it returns false. Example : <?php $con = mysql_connect ( localhost, root ) ; if ($con) { econ Connected with MySQL ; } else { echo Can not connect with MySQL ; }?> 32

33 2. mysql_select_db ( ) : This function allows you to select database from the list of MySQL server database for performing various operations. Syntax : mysql_selectdb( DatabaseName, connectionname) ; DatabaseName : Indicates the name of the database that you want to select. ConnectionName : Indicates the name of the variable that is used at the time of established connection with MySQL server using mysql_connect ( ) function. This function returs a Boolean value TRUE or FALSE. If Function successfully executed then it returns TRUE otherwise it return false. 33

34 Example : <?php $con = mysql_connect ( localhost,root ) ; $db = mysql_selectdb ( MyDatabase ) ; if ($db) { echo Database Selected Successfully ; } else { echo Error while selecting the Database ; }?> 34

35 3. mysql_query ( ) : This function allows you to specify and execute the MySQL command on MySQL Server. Syntax : Mysql_query ( Query, COnnectionName) ; Here, Query : Indicates the MySQL command to be executed. ConnectionName : Indicates the name of the variable that is used at the time of establish connection with MySQL server using mysql_connect ( ) function. 35

36 Example : <?php $con = mysql_connect ( localhost, root ) ; $db = mysql_selectdb ( MyDatabase ) ; $cmd = mysql_query ( create table Test (ID integer, Name varchar (20)) ) ; if ($cmd) { echo Table created Successfully ; } else { echo Error while Executing query ; 36 }?>

37 4. mysql_fetch_row ( ) : This function allows you to retrieve a record from the record set that is returned from executing the MySQL query. The record that is returned by this function is in the form of numeric array. Numeric array contains idex and value associated with that index. If there is no record in the record set then it returns false value. Syntax : mysql_fetch_row ($VariableName) ; Here, Variable Name : Indicates the record set that is returned from executing the MySQL command using mysql_query ( ) function. 37

38 Example : <?php $con = mysql_connect ( localhost, root ) ; mysql_select_db ( Mydatabase, $con) ; $sql = select * from Package_Master ; $result = mysql_query ($sql, $con) ; $Ans = mysql_fetch_row ($result) ; print_r ($Ans) ; mysql_close ($con) ;?> 38

39 5. mysql_fetch_array ( ) : This function allows you to retrieve a record from the record set that is returned from executing the MySQL query. The record that is returned by this function is in the form of numeric array, associative array or both. If there is no record in the record set then it returns false value. Syntax : mysql_fetch_array ($VariableName, ArrayType) ; 39

40 Here, Variable Name : Indicates the record set that is returned from executing the MySQL command using mysql_query ( ) function. Array Type indicates the type of the array to be returned. It can have one of the following value : (1) MYSQL_ASSOC : This type of array contains name of the field and the value associated with that field for current record. (2) MYSQL_NUM : This type array contains index of the field and the value associated with that index for current record. (3) MYSQL_BOTH : It is combination of both Associative array and Numeric array. It is the default type to be returned by this function. 40

41 Example : <?php $con = mysql_connect ( localhost, root ) ; mysql_select_db ( mydatabase, $con) ; $sql = select * from Package_Master ; $result = mysql_query ($sql, $con) $Ans = mysql_query_fetch_array($result, MYSQL_ASSOC) ; print_r ($Ans) ; mysql_close ($con)?> 41

42 6. mysql_num_row ( ) : This function allows you to retrieve number of record available in the record set. Syntax : $Number = mysql_num_rows ($QueryResult) ; Here, QueryResult is the variable that holds the result returned by mysql_query ( ) function. It returns numeric value which contains number of records available in the record set. 42

43 Example : <?php $con = mysql_connect ( localhost, root ) ; mysql_select_db ( mydatabase, $con) ; $sql = select * from Package_Master ; $result = mysql_query ($sql, $con) $record = mysql_num_rows ($result) ; echo $ records, Records ; mysql_close ($con) ;?> 43

44 7. mysql_error ( ) : This function allows you to retrieve the description of error that is encountered while executing the script. If the script contains more then one errors then it will returns error description of the last statement in which error is encountered. If no error encountered while executing the script then it will returns blank string. Syntax : mysql_error ( ) ; 44

45 8. mysql_close ( ) : This function allows you to close the connection that is established using mysql_connect ( ) function. Syntax : mysql_close (ConnectionName) Here, ConnectionName : Indicates the name of the variable that is used at the time of establish connection with MySQL server using mysql_connect ( ) function. It returns a Boolean value TRUE or FALSE. If connection closed successfully then it returns TRUE 45 otherwise it returns FALSE.

46 5.3 CREATING DATABASE USING PHPMYADMIN & CONSOLE( USING QUERY, USING WAMP SERVER) We can work with mysql in any of the following three ways: 1. Using phpmyadmin We can perform database operations using phpmyadmin as follows: Click on phpmyadmin from wampserver icon in the taskbar You will be displayed with phpmyadmin window 2. Using PHP script With PHP scripts we can work with MySQL [ not in 46 syllabus]

47 3. Using MySQL console To use MySQL with wampserver we need to connect it as follows: Click on wampserver then click on MySQL option Click on MySQL console Press Enter key because the default password is blank You will be now displayed with mysql prompt 47

48 1. Using phpmyadmin Launch phpmyadmin Enter name of new database 48

49 Click on create button It will create new database and display statement 49

50 2. Using PHP script Example : <?php $con = mysql_connect ( localhost,root ) ; $db = mysql_selectdb ( MyDatabase ) ; if ($db) { echo Database Selected Successfully ; } else { echo Error while selecting the Database ; }?> 50

51 Launch MS-DOS Change current working directory to C:\wamp\bin\mysql\mysql5.5.8\bin> Type mysql u root, press enter Now you will get the prompt mysql> to type any SQL query from terminal(console) Type command: create database DWPD; It will create database named DWPD in Mysql 51

52 5.4 CONNECTING WITH PHP/ DATABASE CONNECTION, CREATING AND EXECUTING QUERIES USING MYSQL_QUERY() Connecting with PHP/ Database Connection PHP allows you to connect with MySQL server using mysql_connect built-in fuction. Syntax: $ VariableName = mysql_connect (servername, UserName, Password) 52

53 ServerName : Indicates the name of the MySQL server with which you want to establish connection. UserName : Indicates name of the user using which you can logs on to MySQL server. Password : Indicates password of the user using which you can logs on to MySQL Server. This Function returns a Boolean value TRUE or FALSE. If connection establish successfully with MySQL Server then this function returns true value otherwise it returns false. 53

54 Creating and executing queries using mysql_query(): This function allows you to specify and execute the MySQL command on MySQL Server Syntax : Mysql_query ( Query, COnnectionName) ; Query : Indicates the MySQL command to be executed. ConnectionName : Indicates the name of the variable that is used at the time of establish connection with MySQL server using mysql_connect ( ) function. 54

55 Example : <?php $con = mysql_connect ( localhost, root ) ; $db = mysql_selectdb ( MyDatabase ) ; $cmd = mysql_query ( create table Test (ID integer, Name varchar (20)) ) ; if ($cmd) { echo Table created Successfully ; } else { echo Error while Executing query ; }?> 55

56 5.5 CREATING TABLES, INSERTING DATA IN TO TABLE, INSERTING DATA THROUGH HTML FORMS We can work with mysql in any of the following three ways: 1. Using phpmyadmin 2. Using PHP 3. Using MySQL console 56

57 USING PHPMYADMIN Launch phpmyadmin Select name of database Enter name of new table and specify how many fields you want to add in table. Click on GO button It will ask you to define fields for your table by specifying field name and datatype Click on save button it will create new table with specified field and display statement Now if you want to define primary key then select field name and click on primary key It will display confirmation message click on ok 57

58 USING PHP SCRIPT To create table using php script: <?php $con = mysql_connect ( localhost, root ) ; //Select database mysql_select_db( DBDEMO ); //Specify query to create table $sql = create table customer( cus_code number, cus_name varchar2(20), city varchar(20)) ; //Execute query mysql_query($sql); //Close the connection mysql_close($con); 58 echo Table created successfully ;?>

59 USING CONSOLE To create table using console: 1. Launch MS-DOS 2. Change current working directory to c:\wamp\bin\mysql\mysql5.5.8\bin> 3. Type mysql u root. As you press enter key command prompt will be changed to mysql> 4. Now you can run SQL query from terminal. 5. Type the commands use DWD to open database 6. Write query to create table 59

60 INSERTING DATA INTO TABLE Inserting records in the table using PHPMyAdmin in order to insert new records in table select name of the table from the database and then click on insert link. It will display following screen. enter value in the textbox and click on GO. As you click on GO button it will insert record in the table and display insert statement. 60

61 Inserting records in the table using PHP script <?php //Establish connection with mysql $con = mysql_connect ( localhost, root ) ; //Select database mysql_select_db( DBDEMO ); //Specify query to create table $sql = insert into customer(cus_code, cus_name, city) values (1, abc, abad ) ; //Execute query mysql_query($sql); //Close the connection mysql_close($con); echo Data inserted successfully ;?> 61

62 5.6 RETRIEVING DATA FROM TABLE, USING MYSQL_NUMROWS(), PRINTING THE OUTPUT USING PHP AND HTML Step 1 : Establish connection with my sql server. Step 2 : select database from the my sql server. Step 3 : Specify the select query to retrieve records from datable table and execute it. Step 4 : Loop through each records that is retrieved from the database table and display them in the HTML table. 62

63 Write the following script in the PHP to display data from the database table in HTML table : <html> <head><title> display information using table </title></head> <body> <table border= 1 ><tr> <th>package code</th> <th>packge name</th> <th> total days</th> <th>packge cost</th></tr> <?php $con=mysql_connect( localhost, root ); Mysql_select_db( my database,$con); $sql= select*from package_master ; $result=mysql_query($sql,$con); 63

64 While ($row=mysql_fetch_array($result)) { $code=$row[ packagecode ]; $name=$row [ packagename ]; $days=$row[ totaldays ]; $cost=$row[ packagecost ];?> <tr> <td><?php echo $code;?></td> <td><?php echo $name;?></td> <td><?php echo $days;?></td> <td><?php echo $cost;?></td></tr> <?php } $record=mysql_num_rows($result);?> <tr> <td><?php echo $record. record ;?> </td> <?php Mysql_close($con);?> </tr></table></body></html> 64

65 OUTPUT: 65

66 ADDING LINKS TO THE TABLE AND DISPLAYING THE DETAILS. In relational database managements system a database consist of more then one tables and these tables are related with each other in one or another way. In such situation it is required to provide hyperlink in the displayed table so when user click on the hyperlink of particular record it will display detail description of that record in another page. 66

67 Here. Package_Master table contains list of packages available and package_detaill table contains detailed information of package_master table. <html> <head><title> display information using table </title></head> <body> <table border= 1 ><tr> <th>package code</th> <th>packge name</th> <th> total days</th> <th>packge cost</th> <th>package detail </th></tr> 67

68 <?php $con=mysql_connect( localhost, root ) ; Mysql_select_db( my database,$con); $sql= select*from package_master ; $result=mysql_query($sql,$con); While ($row=mysql_fetch_array($result)) { $code=$row[ packagecode ]; $name=$row [ packagename ]; $days=$row[ totaldays ]; $cost=$row[ packagecost ];?> 68

69 <tr><td><?php echo $code;?></td> <td><?php echo $name;?></td> <td><?php echo $days;?></td> <td><?php echo $cost;?></td> <td><a href= packagedetail.php?packegecode=<?php echo code;?> >detail</a></td></tr> <?php } $record=mysql_num_rows($result);?> <tr> <td><?php echo $record. record ;?> </td> <?php Mysql_close($con);?></table></body></html> 69

70 In above script we add hyperlink field in the table and cinstrust query string that contains package code along with url. So when user click on hyperlink it will redirectd to package detailed to php file along with package code with query string. Now in order to display information of the package whose packagecode is passed in the query string write 70 following script in packagedetail.php file as shown below :

71 <html> <head><title> display information using table </title></head> <body> <table border= 1 ><tr> <th>day</th> <th>places to visit</th> </tr> <?php $con=mysql_connect( localhost, root ); Mysql_select_db( mydatabase,$con); $sql= select * from package_ detail where pa.$_get[ packagecode ]. ; $result= mysql_query($sql,$con); While($row = mysql_fetch_array(result)) { $day=$row[ dayname ]; $place=$row[ placestovisit ]; 71?>

72 <tr> <td><?php echo $day;?></td> <td><?php echo $places;?></td> </tr> <?php } Mysql_close($con);?></table></body></html> Above script retrieves packagecode from url using gate method and display detailed information of that package code as shown below : 72

73 5.7 Searching a record, displaying record fields in HTML form controls, Updating and deleting records Steps to delete record from table using phpmyadmin Select name of the table from database.browse link it will display all records from table. Select record from list and click delete button. As you click on button it will display confirmation message. Click on OK button to delete record. 73

74 Steps to update record from table using phpmyadmin Select name of the table from database. Browse link it will display all records from table. Select record from list and click update button. As you click on button it will display confirmation message. Click on OK button to delete record. 74

75 Searching a record using php script Search.php <htmll><body> <form action= result.php" name="frmsearch" method="post"> Enter customer code:<input type="text" name= txtcode"><br> <input type="submit" name="submit" value= submit"><br> </form> </body> </html> 75

76 Result.php <html><body> <?php $code = $_POST[ txtcode ]; $con = mysql_connect ( localhost,root ) ; $db = mysql_selectdb ( MyDatabase ) ; $sql= select * from customer where code=.$code. ; $result=mysql_query($sql); While($row = mysql_fetch_array($result)) { $code = $row[code]; $name = $row[name]; $city = $row[city]; }?> 76

77 <form method= post action= delete.php > <table border=1> <tr><td>customer code: </td> <td><input type= text name= code value= <?php echo $code;?> /></td></tr> <tr><td>customer name: </td> <td><input type= text name= code value= <?php echo $name;?> /></td></tr> <tr><td>customer city: </td> <td><input type= text name= code value= <?php echo $city;?> /></td></tr> <tr><td> </td> <td><input type= submit name= submit value= update /></td></tr> </table></form> <?php mysql_close();?> </body></html> 77

78 Delete.php <?php $code = $_POST[ code ]; $con = mysql_connect ( localhost,root ) ; $db = mysql_selectdb ( MyDatabase ) ; $sql = delete from customer where code=.$code. ; Mysql_query($sql); Mysql_clode(); Echo record deleted successfully ;?> 78

79 UPDATE RECORD <?php $con=mysqli_connect("localhost","root","root"); $db=mysqli_select_db($con,"student1"); if($db) { echo "database selected<br>"; } else { echo "Database not selected<br>"; } $name=$_post['txtuser']; $no=$_post['txteno']; 79

80 $sql= "update stu_info set sname='$name' where sno='$no'"; if(mysqli_query($con,$sql)) { echo "Record is Updated successfully"."<br>"; } else { echo "Record is not Updated"."<br>"; }?> 80

81 5.8 Hosting Website (Using C panel, Using Filezilla Software cpanel is a web based control panel tool which will help you manage your web hosting account through a web interface instead of a console. With cpanel you are able to accomplish your tasks faster and even non-professionals can easily set their websites via cpanel. Please check this link to use cpanel anager.htm 81

82 5.9 Working on mini PHP Project: Developing a sample web based application and hosting it Review the link for mini PHP Projects Review point 5.8 for hosting 82

83 THANK YOU 83

What is MySQL? [Document provides the fundamental operations of PHP-MySQL connectivity]

What is MySQL? [Document provides the fundamental operations of PHP-MySQL connectivity] What is MySQL? [Document provides the fundamental operations of PHP-MySQL connectivity] MySQL is a database. A database defines a structure for storing information. In a database, there are tables. Just

More information

Lab # 2 Hands-On. DDL Basic SQL Statements Institute of Computer Science, University of Tartu, Estonia

Lab # 2 Hands-On. DDL Basic SQL Statements Institute of Computer Science, University of Tartu, Estonia Lab # 2 Hands-On DDL Basic SQL Statements Institute of Computer Science, University of Tartu, Estonia Part A: Demo by Instructor in Lab a. Data type of MySQL b. CREATE table c. ALTER table (ADD, CHANGE,

More information

PHP Development - Introduction

PHP Development - Introduction PHP Development - Introduction Php Hypertext Processor PHP stands for PHP: Hypertext Preprocessor PHP is a server-side scripting language, like ASP PHP scripts are executed on the server PHP supports many

More information

Introduction to SQL on GRAHAM ED ARMSTRONG SHARCNET AUGUST 2018

Introduction to SQL on GRAHAM ED ARMSTRONG SHARCNET AUGUST 2018 Introduction to SQL on GRAHAM ED ARMSTRONG SHARCNET AUGUST 2018 Background Information 2 Background Information What is a (Relational) Database 3 Dynamic collection of information. Organized into tables,

More information

TINYINT[(M)] [UNSIGNED] [ZEROFILL] A very small integer. The signed range is -128 to 127. The unsigned range is 0 to 255.

TINYINT[(M)] [UNSIGNED] [ZEROFILL] A very small integer. The signed range is -128 to 127. The unsigned range is 0 to 255. MySQL: Data Types 1. Numeric Data Types ZEROFILL automatically adds the UNSIGNED attribute to the column. UNSIGNED disallows negative values. SIGNED (default) allows negative values. BIT[(M)] A bit-field

More information

The M in LAMP: MySQL CSCI 470: Web Science Keith Vertanen Copyright 2014

The M in LAMP: MySQL CSCI 470: Web Science Keith Vertanen Copyright 2014 The M in LAMP: MySQL CSCI 470: Web Science Keith Vertanen Copyright 2014 MySQL Setup, using console Data types Overview Creating users, databases and tables SQL queries INSERT, SELECT, DELETE WHERE, ORDER

More information

Chapter 8: Working With Databases & Tables

Chapter 8: Working With Databases & Tables Chapter 8: Working With Databases & Tables o Working with Databases & Tables DDL Component of SQL Databases CREATE DATABASE class; o Represented as directories in MySQL s data storage area o Can t have

More information

Careerarm.com. 1. What is MySQL? MySQL is an open source DBMS which is built, supported and distributed by MySQL AB (now acquired by Oracle)

Careerarm.com. 1. What is MySQL? MySQL is an open source DBMS which is built, supported and distributed by MySQL AB (now acquired by Oracle) 1. What is MySQL? MySQL is an open source DBMS which is built, supported and distributed by MySQL AB (now acquired by Oracle) 2. What are the technical features of MySQL? MySQL database software is a client

More information

Data Definition Language with mysql. By Kautsar

Data Definition Language with mysql. By Kautsar Data Definition Language with mysql By Kautsar Outline Review Create/Alter/Drop Database Create/Alter/Drop Table Create/Alter/Drop View Create/Alter/Drop User Kautsar -2 Review Database A container (usually

More information

PHP: Cookies, Sessions, Databases. CS174. Chris Pollett. Sep 24, 2008.

PHP: Cookies, Sessions, Databases. CS174. Chris Pollett. Sep 24, 2008. PHP: Cookies, Sessions, Databases. CS174. Chris Pollett. Sep 24, 2008. Outline. How cookies work. Cookies in PHP. Sessions. Databases. Cookies. Sometimes it is useful to remember a client when it comes

More information

Create Basic Databases and Integrate with a Website Lesson 3

Create Basic Databases and Integrate with a Website Lesson 3 Create Basic Databases and Integrate with a Website Lesson 3 Combining PHP and MySQL This lesson presumes you have covered the basics of PHP as well as working with MySQL. Now you re ready to make the

More information

COM1004 Web and Internet Technology

COM1004 Web and Internet Technology COM1004 Web and Internet Technology When a user submits a web form, how do we save the information to a database? How do we retrieve that data later? ID NAME EMAIL MESSAGE TIMESTAMP 1 Mike mike@dcs Hi

More information

Chapter. Accessing MySQL Databases Using PHP

Chapter. Accessing MySQL Databases Using PHP Chapter 12 Accessing MySQL Databases Using PHP 150 Essential PHP fast Introduction In the previous chapter we considered how to create databases using MySQL. While this is useful, it does not enable us

More information

More loops. Control structures / flow control. while loops. Loops / Iteration / doing things over and over and over and over...

More loops. Control structures / flow control. while loops. Loops / Iteration / doing things over and over and over and over... Control structures / flow control More loops while loops if... else Switch for loops while... do.. do... while... Much of this material is explained in PHP programming 2nd Ed. Chap 2 Control structures

More information

Overview of MySQL Structure and Syntax [2]

Overview of MySQL Structure and Syntax [2] PHP PHP MySQL Database Overview of MySQL Structure and Syntax [2] MySQL is a relational database system, which basically means that it can store bits of information in separate areas and link those areas

More information

PHP. How Web Applications interact with server side databases CRUD. Connecting and using mysql from PHP PHP provides many mysql specific functions

PHP. How Web Applications interact with server side databases CRUD. Connecting and using mysql from PHP PHP provides many mysql specific functions PHP How Web Applications interact with server side databases CRUD Connecting and using mysql from PHP PHP provides many mysql specific functions mysql_connect mysql_select_db mysql_query mysql_fetch_array

More information

Data Types in MySQL CSCU9Q5. MySQL. Data Types. Consequences of Data Types. Common Data Types. Storage size Character String Date and Time.

Data Types in MySQL CSCU9Q5. MySQL. Data Types. Consequences of Data Types. Common Data Types. Storage size Character String Date and Time. - Database P&A Data Types in MySQL MySQL Data Types Data types define the way data in a field can be manipulated For example, you can multiply two numbers but not two strings We have seen data types mentioned

More information

An introduction for the novice. David Lawrence, JLab. 5/8/07 MySQL David Lawrence 1/36

An introduction for the novice. David Lawrence, JLab. 5/8/07 MySQL David Lawrence 1/36 An introduction for the novice David Lawrence, JLab 5/8/07 MySQL David Lawrence 1/36 What is a Database? Store information(data) in a reliable, accessible way Allow access to data over a network to multiple

More information

Database Connectivity using PHP Some Points to Remember:

Database Connectivity using PHP Some Points to Remember: Database Connectivity using PHP Some Points to Remember: 1. PHP has a boolean datatype which can have 2 values: true or false. However, in PHP, the number 0 (zero) is also considered as equivalent to False.

More information

Create Basic Databases and Integrate with a Website Lesson 1

Create Basic Databases and Integrate with a Website Lesson 1 Create Basic Databases and Integrate with a Website Lesson 1 Getting Started with Web (SQL) Databases In order to make a web database, you need three things to work in cooperation. You need a web server

More information

Web Programming. Dr Walid M. Aly. Lecture 10 PHP. lec10. Web Programming CS433/CS614 22:32. Dr Walid M. Aly

Web Programming. Dr Walid M. Aly. Lecture 10 PHP. lec10. Web Programming CS433/CS614 22:32. Dr Walid M. Aly Web Programming Lecture 10 PHP 1 Purpose of Server-Side Scripting database access Web page can serve as front-end to a database Ømake requests from browser, Øpassed on to Web server, Øcalls a program to

More information

SQL. Often times, in order for us to build the most functional website we can, we depend on a database to store information.

SQL. Often times, in order for us to build the most functional website we can, we depend on a database to store information. Often times, in order for us to build the most functional website we can, we depend on a database to store information. If you ve ever used Microsoft Excel or Google Spreadsheets (among others), odds are

More information

SQL Data Definition and Data Manipulation Languages (DDL and DML)

SQL Data Definition and Data Manipulation Languages (DDL and DML) .. Cal Poly CPE/CSC 365: Introduction to Database Systems Alexander Dekhtyar.. SQL Data Definition and Data Manipulation Languages (DDL and DML) Note: This handout instroduces both the ANSI SQL synatax

More information

Chapter # 7 Introduction to Structured Query Language (SQL) Part I

Chapter # 7 Introduction to Structured Query Language (SQL) Part I Chapter # 7 Introduction to Structured Query Language (SQL) Part I Introduction to SQL SQL functions fit into two broad categories: Data definition language Data manipulation language Basic command set

More information

SQL Commands & Mongo DB New Syllabus

SQL Commands & Mongo DB New Syllabus Chapter 15 : Computer Science Class XI ( As per CBSE Board) SQL Commands & Mongo DB New Syllabus 2018-19 SQL SQL is an acronym of Structured Query Language.It is a standard language developed and used

More information

Chapter 6 Part2: Manipulating MySQL Databases with PHP

Chapter 6 Part2: Manipulating MySQL Databases with PHP IT215 Web Programming 1 Chapter 6 Part2: Manipulating MySQL Databases with PHP Jakkrit TeCho, Ph.D. Business Information Technology (BIT), Maejo University Phrae Campus Objectives In this chapter, you

More information

By the end of this section of the practical, the students should be able to:

By the end of this section of the practical, the students should be able to: By the end of this section of the practical, the students should be able to: Connecting to a MySQL database in PHP with the mysql_connect() and mysql_select_db() functions Trapping and displaying database

More information

PHP Tutorial 6(a) Using PHP with MySQL

PHP Tutorial 6(a) Using PHP with MySQL Objectives After completing this tutorial, the student should have learned; The basic in calling MySQL from PHP How to display data from MySQL using PHP How to insert data into MySQL using PHP Faculty

More information

IELM 511 Information Systems Design Labs 5 and 6. DB creation and Population

IELM 511 Information Systems Design Labs 5 and 6. DB creation and Population IELM 511 Information Systems Design Labs 5 and 6. DB creation and Population In this lab, your objective is to learn the basics of creating and managing a DB system. One way to interact with the DBMS (MySQL)

More information

Princess Nourah bint Abdulrahman University. Computer Sciences Department

Princess Nourah bint Abdulrahman University. Computer Sciences Department Princess Nourah bint Abdulrahman University Computer Sciences Department 1 And use http://www.w3schools.com/ PHP Part 3 Objectives Creating a new MySQL Database using Create & Check connection with Database

More information

SQL Fundamentals. Chapter 3. Class 03: SQL Fundamentals 1

SQL Fundamentals. Chapter 3. Class 03: SQL Fundamentals 1 SQL Fundamentals Chapter 3 Class 03: SQL Fundamentals 1 Class 03: SQL Fundamentals 2 SQL SQL (Structured Query Language): A language that is used in relational databases to build and query tables. Earlier

More information

Chapter 13 : Informatics Practices. Class XI ( As per CBSE Board) SQL Commands. New Syllabus Visit : python.mykvs.in for regular updates

Chapter 13 : Informatics Practices. Class XI ( As per CBSE Board) SQL Commands. New Syllabus Visit : python.mykvs.in for regular updates Chapter 13 : Informatics Practices Class XI ( As per CBSE Board) SQL Commands New Syllabus 2018-19 SQL SQL is an acronym of Structured Query Language.It is a standard language developed and used for accessing

More information

Data and Tables. Bok, Jong Soon

Data and Tables. Bok, Jong Soon Data and Tables Bok, Jong Soon Jongsoon.bok@gmail.com www.javaexpert.co.kr Learning MySQL Language Structure Comments and portability Case-sensitivity Escape characters Naming limitations Quoting Time

More information

Information Systems Engineering. SQL Structured Query Language DDL Data Definition (sub)language

Information Systems Engineering. SQL Structured Query Language DDL Data Definition (sub)language Information Systems Engineering SQL Structured Query Language DDL Data Definition (sub)language 1 SQL Standard Language for the Definition, Querying and Manipulation of Relational Databases on DBMSs Its

More information

Oracle SQL Developer. Supplementary Information for MySQL Migrations Release 2.1 E

Oracle SQL Developer. Supplementary Information for MySQL Migrations Release 2.1 E Oracle SQL Developer Supplementary Information for MySQL Migrations Release 2.1 E15225-01 December 2009 This document contains information for migrating from MySQL to Oracle. It supplements the information

More information

Full file at

Full file at ch2 True/False Indicate whether the statement is true or false. 1. The SQL command to create a database table is an example of DML. 2. A user schema contains all database objects created by a user. 3.

More information

Introduction to IBM DB2

Introduction to IBM DB2 Introduction to IBM DB2 Architecture Client-server system Server: SERVEDB, servedb.ing.man 10.17.2.91 Client: IBM Data Studio: graphical DB2 Command Window: command line 2 Architecture Servers, instances,

More information

*this is a guide that was created from lecture videos and is used to help you gain an understanding of what is mysql used for.

*this is a guide that was created from lecture videos and is used to help you gain an understanding of what is mysql used for. mysql. 1 what is mysql used for. *this is a guide that was created from lecture videos and is used to help you gain an understanding of what is mysql used for. MySQL Installation MySQL is an open source

More information

Chapter 3 Introduction to relational databases and MySQL

Chapter 3 Introduction to relational databases and MySQL Chapter 3 Introduction to relational databases and MySQL Murach's PHP and MySQL, C3 2014, Mike Murach & Associates, Inc. Slide 1 Objectives Applied 1. Use phpmyadmin to review the data and structure of

More information

SQL stands for Structured Query Language. SQL lets you access and manipulate databases

SQL stands for Structured Query Language. SQL lets you access and manipulate databases CMPSC 117: WEB DEVELOPMENT SQL stands for Structured Query Language SQL lets you access and manipulate databases SQL is an ANSI (American National Standards Institute) standard 1 SQL can execute queries

More information

Tool/Web URL Features phpmyadmin. More on phpmyadmin under User Intefaces. MySQL Query Browser

Tool/Web URL Features phpmyadmin.   More on phpmyadmin under User Intefaces. MySQL Query Browser To store data in MySQL, we will set up a database and then place tables, relationships and other objects in that database, following a design that maps to our application requirements. We will use a command-line

More information

Lab # 4. Data Definition Language (DDL)

Lab # 4. Data Definition Language (DDL) Islamic University of Gaza Faculty of Engineering Department of Computer Engineering ECOM 4113: Lab # 4 Data Definition Language (DDL) Eng. Haneen El-Masry November, 2014 2 Objective To be familiar with

More information

EE 495M - Lecture 3. Overview

EE 495M - Lecture 3. Overview EE 495M - Lecture 3 mysql and PHP Mustafa Kamasak September 10, 2003 Overview Database Tier (MySQL) SQL Logic Tier (PHP) Web Server Presentation Tier (Browsers) MySQL SQL PHP MySQL & PHP interface MySQL

More information

Basis Data Terapan. Yoannita

Basis Data Terapan. Yoannita Basis Data Terapan Yoannita SQL Server Data Types Character strings: Data type Description Storage char(n) varchar(n) varchar(max) text Fixed-length character string. Maximum 8,000 characters Variable-length

More information

Course Outline and Objectives: Database Programming with SQL

Course Outline and Objectives: Database Programming with SQL Introduction to Computer Science and Business Course Outline and Objectives: Database Programming with SQL This is the second portion of the Database Design and Programming with SQL course. In this portion,

More information

Acknowledgments About the Authors

Acknowledgments About the Authors Acknowledgments p. xi About the Authors p. xiii Introduction p. xv An Overview of MySQL p. 1 Why Use an RDBMS? p. 2 Multiuser Access p. 2 Storage Transparency p. 2 Transactions p. 3 Searching, Modifying,

More information

PHP Introduction. Some info on MySQL which we will cover in the next workshop...

PHP Introduction. Some info on MySQL which we will cover in the next workshop... PHP and MYSQL PHP Introduction PHP is a recursive acronym for PHP: Hypertext Preprocessor -- It is a widely-used open source general-purpose serverside scripting language that is especially suited for

More information

GridDB Advanced Edition SQL reference

GridDB Advanced Edition SQL reference GMA022C1 GridDB Advanced Edition SQL reference Toshiba Solutions Corporation 2016 All Rights Reserved. Introduction This manual describes how to write a SQL command in the GridDB Advanced Edition. Please

More information

Previously everyone in the class used the mysql account: Username: csci340user Password: csci340pass

Previously everyone in the class used the mysql account: Username: csci340user Password: csci340pass Database Design, CSCI 340, Spring 2016 SQL, Transactions, April 15 Previously everyone in the class used the mysql account: Username: csci340user Password: csci340pass Personal mysql accounts have been

More information

Database Systems. phpmyadmin Tutorial

Database Systems. phpmyadmin Tutorial phpmyadmin Tutorial Please begin by logging into your Student Webspace. You will access the Student Webspace by logging into the Campus Common site. Go to the bottom of the page and click on the Go button

More information

Server side scripting and databases

Server side scripting and databases Example table Server side scripting and databases student How Web Applications interact with server side databases - part 2 student kuid lastname money char char int student table Connecting and using

More information

MTAT Introduction to Databases

MTAT Introduction to Databases MTAT.03.105 Introduction to Databases Lecture #3 Data Types, Default values, Constraints Ljubov Jaanuska (ljubov.jaanuska@ut.ee) Lecture 1. Summary SQL stands for Structured Query Language SQL is a standard

More information

DB Programming. Database Systems

DB Programming. Database Systems DB Programming Database Systems 1 Agenda MySQL data types Altering the Schema More Advanced MySQL JDBC DB Coding Tips 2 MySQL Data Types There are 3 main groups of types: Numeric Date String http://dev.mysql.com/doc/refman/5.6/en/data-types.html

More information

CSCI-UA: Database Design & Web Implementation. Professor Evan Sandhaus

CSCI-UA: Database Design & Web Implementation. Professor Evan Sandhaus CSCI-UA:0060-02 Database Design & Web Implementation Professor Evan Sandhaus sandhaus@cs.nyu.edu evan@nytimes.com Lecture #10: Open Office Base, Life on the Console, MySQL Database Design and Web Implementation

More information

SQL: Concepts. Todd Bacastow IST 210: Organization of Data 2/17/ IST 210

SQL: Concepts. Todd Bacastow IST 210: Organization of Data 2/17/ IST 210 SQL: Concepts Todd Bacastow IST 210: Organization of Data 2/17/2004 1 Design questions How many entities are there? What are the major entities? What are the attributes of each entity? Is there a unique

More information

Lab # 2. Data Definition Language (DDL) Eng. Alaa O Shama

Lab # 2. Data Definition Language (DDL) Eng. Alaa O Shama The Islamic University of Gaza Faculty of Engineering Department of Computer Engineering ECOM 4113: Database Lab Lab # 2 Data Definition Language (DDL) Eng. Alaa O Shama October, 2015 Objective To be familiar

More information

Lab 7 Introduction to MySQL

Lab 7 Introduction to MySQL Lab 7 Introduction to MySQL Objectives: During this lab session, you will - Learn how to access the MySQL Server - Get hand-on experience on data manipulation and some PHP-to-MySQL technique that is often

More information

More MySQL ELEVEN Walkthrough examples Walkthrough 1: Bulk loading SESSION

More MySQL ELEVEN Walkthrough examples Walkthrough 1: Bulk loading SESSION SESSION ELEVEN 11.1 Walkthrough examples More MySQL This session is designed to introduce you to some more advanced features of MySQL, including loading your own database. There are a few files you need

More information

Chapter-14 SQL COMMANDS

Chapter-14 SQL COMMANDS Chapter-14 SQL COMMANDS What is SQL? Structured Query Language and it helps to make practice on SQL commands which provides immediate results. SQL is Structured Query Language, which is a computer language

More information

Lecture 7: Web hacking 3, SQL injection, Xpath injection, Server side template injection, File inclusion

Lecture 7: Web hacking 3, SQL injection, Xpath injection, Server side template injection, File inclusion IN5290 Ethical Hacking Lecture 7: Web hacking 3, SQL injection, Xpath injection, Server side template injection, File inclusion Universitetet i Oslo Laszlo Erdödi Lecture Overview What is SQL injection

More information

D B M G. SQL language: basics. Managing tables. Creating a table Modifying table structure Deleting a table The data dictionary Data integrity

D B M G. SQL language: basics. Managing tables. Creating a table Modifying table structure Deleting a table The data dictionary Data integrity SQL language: basics Creating a table Modifying table structure Deleting a table The data dictionary Data integrity 2013 Politecnico di Torino 1 Creating a table Creating a table (1/3) The following SQL

More information

SQL Data Definition Language: Create and Change the Database Ray Lockwood

SQL Data Definition Language: Create and Change the Database Ray Lockwood Introductory SQL SQL Data Definition Language: Create and Change the Database Pg 1 SQL Data Definition Language: Create and Change the Database Ray Lockwood Points: DDL statements create and alter the

More information

mysql Certified MySQL 5.0 DBA Part I

mysql Certified MySQL 5.0 DBA Part I mysql 005-002 Certified MySQL 5.0 DBA Part I http://killexams.com/exam-detail/005-002 QUESTION: 116 Which of the following correctly defines the general difference between a read lock and a write lock?

More information

Model Question Paper. Credits: 4 Marks: 140

Model Question Paper. Credits: 4 Marks: 140 Model Question Paper Subject Code: BT0075 Subject Name: RDBMS and MySQL Credits: 4 Marks: 140 Part A (One mark questions) 1. MySQL Server works in A. client/server B. specification gap embedded systems

More information

SQL language. Jaroslav Porubän, Miroslav Biňas, Milan Nosáľ (c)

SQL language. Jaroslav Porubän, Miroslav Biňas, Milan Nosáľ (c) SQL language Jaroslav Porubän, Miroslav Biňas, Milan Nosáľ (c) 2011-2016 SQL - Structured Query Language SQL is a computer language for communicating with DBSM Nonprocedural (declarative) language What

More information

Chapter 3. Introduction to relational databases and MySQL. 2010, Mike Murach & Associates, Inc. Murach's PHP and MySQL, C3

Chapter 3. Introduction to relational databases and MySQL. 2010, Mike Murach & Associates, Inc. Murach's PHP and MySQL, C3 1 Chapter 3 Introduction to relational databases and MySQL Slide 2 Objectives Applied 1. Use phpmyadmin to review the data and structure of the tables in a database, to import and run SQL scripts that

More information

Department of Computer Science University of Cyprus. EPL342 Databases. Lab 2

Department of Computer Science University of Cyprus. EPL342 Databases. Lab 2 Department of Computer Science University of Cyprus EPL342 Databases Lab 2 ER Modeling (Entities) in DDS Lite & Conceptual Modeling in SQL Server 2008 Panayiotis Andreou http://www.cs.ucy.ac.cy/courses/epl342

More information

Chapter 8 How to work with data types

Chapter 8 How to work with data types Chapter 8 How to work with data types Murach's MySQL, C8 2015, Mike Murach & Associates, Inc. Slide 1 Objectives Applied Code queries that convert data from one data type to another. Knowledge Describe

More information

Web Application Development (WAD) V th Sem BBAITM (Unit 4) By: Binit Patel

Web Application Development (WAD) V th Sem BBAITM (Unit 4) By: Binit Patel Web Application Development (WAD) V th Sem BBAITM (Unit 4) By: Binit Patel Working with Forms: A very popular way to make a web site interactive is using HTML based forms by the site. Using HTML forms,

More information

Module 3 MySQL Database. Database Management System

Module 3 MySQL Database. Database Management System Module 3 MySQL Database Module 3 Contains 2 components Individual Assignment Group Assignment BOTH are due on Mon, Feb 19th Read the WIKI before attempting the lab Extensible Networking Platform 1 1 -

More information

Full file at

Full file at SQL for SQL Server 1 True/False Questions Chapter 2 Creating Tables and Indexes 1. In order to create a table, three pieces of information must be determined: (1) the table name, (2) the column names,

More information

Previously everyone in the class used the mysql account: Username: csci340user Password: csci340pass

Previously everyone in the class used the mysql account: Username: csci340user Password: csci340pass Database Design, CSCI 340, Spring 2016 SQL, Transactions, April 15 Previously everyone in the class used the mysql account: Username: csci340user Password: csci340pass Personal mysql accounts have been

More information

Advanced SQL. Nov 21, CS445 Pacific University 1

Advanced SQL. Nov 21, CS445 Pacific University 1 Advanced SQL Nov 21, 2017 http://zeus.cs.pacificu.edu/chadd/cs445f17/advancedsql.tar.gz Pacific University 1 Topics Views Triggers Stored Procedures Control Flow if / case Binary Data Pacific University

More information

INFORMATION TECHNOLOGY NOTES

INFORMATION TECHNOLOGY NOTES Unit-6 SESSION 7: RESPOND TO A MEETING REQUEST Calendar software allows the user to respond to other users meeting requests. Open the email application to view the request. to respond, select Accept, Tentative,

More information

Mysql Information Schema Update Time Null >>>CLICK HERE<<< doctrine:schema:update --dump-sql ALTER TABLE categorie

Mysql Information Schema Update Time Null >>>CLICK HERE<<< doctrine:schema:update --dump-sql ALTER TABLE categorie Mysql Information Schema Update Time Null I want to update a MySQL database schema (with MySQL code) but I am unfortunately not sure 'name' VARCHAR(64) NOT NULL 'password' VARCHAR(64) NOT NULL fieldname

More information

ElevateDB Version 2 PHP Extension Manual

ElevateDB Version 2 PHP Extension Manual Table of Contents ElevateDB Version 2 PHP Extension Manual Table Of Contents Chapter 1 - Getting Started 1 1.1 Installation and Configuration 1 1.2 Connection Strings 3 1.3 Character Sets 10 1.4 Sample

More information

4) PHP and MySQL. Emmanuel Benoist. Spring Term Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 1

4) PHP and MySQL. Emmanuel Benoist. Spring Term Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 1 4) PHP and MySQL Emmanuel Benoist Spring Term 2017 Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 1 PHP and MySQL Introduction Basics of MySQL Create a Table See

More information

How to use SQL to create a database

How to use SQL to create a database Chapter 17 How to use SQL to create a database How to create a database CREATE DATABASE my_guitar_shop2; How to create a database only if it does not exist CREATE DATABASE IF NOT EXISTS my_guitar_shop2;

More information

STRUCTURED QUERY LANGUAGE (SQL)

STRUCTURED QUERY LANGUAGE (SQL) 1 SQL STRUCTURED QUERY LANGUAGE (SQL) The first questions to ask are what is SQL and how do you use it with databases? SQL has 3 main roles: Creating a database and defining its structure Querying the

More information

This lab will introduce you to MySQL. Begin by logging into the class web server via SSH Secure Shell Client

This lab will introduce you to MySQL. Begin by logging into the class web server via SSH Secure Shell Client Lab 2.0 - MySQL CISC3140, Fall 2011 DUE: Oct. 6th (Part 1 only) Part 1 1. Getting started This lab will introduce you to MySQL. Begin by logging into the class web server via SSH Secure Shell Client host

More information

Introduction to relational databases and MySQL

Introduction to relational databases and MySQL Chapter 3 Introduction to relational databases and MySQL A products table Columns 2017, Mike Murach & Associates, Inc. C3, Slide 1 2017, Mike Murach & Associates, Inc. C3, Slide 4 Objectives Applied 1.

More information

MySQL: an application

MySQL: an application Data Types and other stuff you should know in order to amaze and dazzle your friends at parties after you finally give up that dream of being a magician and stop making ridiculous balloon animals and begin

More information

MySQL Introduction. By Prof. B.A.Khivsara

MySQL Introduction. By Prof. B.A.Khivsara MySQL Introduction 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 not for commercial use. Introduction

More information

CGS 3066: Spring 2017 SQL Reference

CGS 3066: Spring 2017 SQL Reference CGS 3066: Spring 2017 SQL Reference Can also be used as a study guide. Only covers topics discussed in class. This is by no means a complete guide to SQL. Database accounts are being set up for all students

More information

1 INTRODUCTION TO EASIK 2 TABLE OF CONTENTS

1 INTRODUCTION TO EASIK 2 TABLE OF CONTENTS 1 INTRODUCTION TO EASIK EASIK is a Java based development tool for database schemas based on EA sketches. EASIK allows graphical modeling of EA sketches and views. Sketches and their views can be converted

More information

1Z MySQL 5 Database Administrator Certified Professional Exam, Part II Exam.

1Z MySQL 5 Database Administrator Certified Professional Exam, Part II Exam. Oracle 1Z0-874 MySQL 5 Database Administrator Certified Professional Exam, Part II Exam TYPE: DEMO http://www.examskey.com/1z0-874.html Examskey Oracle 1Z0-874 exam demo product is here for you to test

More information

CHAPTER 10. Connecting to Databases within PHP

CHAPTER 10. Connecting to Databases within PHP CHAPTER 10 Connecting to Databases within PHP CHAPTER OBJECTIVES Get a connection to a MySQL database from within PHP Use a particular database Send a query to the database Parse the query results Check

More information

SQL DDL. Intro SQL CREATE TABLE ALTER TABLE Data types Service-based database in Visual Studio Database in PHPMyAdmin

SQL DDL. Intro SQL CREATE TABLE ALTER TABLE Data types Service-based database in Visual Studio Database in PHPMyAdmin SQL DDL Intro SQL CREATE TABLE ALTER TABLE Data types Service-based database in Visual Studio Database in PHPMyAdmin Steen Jensen, autumn 2017 Languages Languages for relational DBMSs are: SQL QBE Structured

More information

COMP519: Web Programming Autumn 2015

COMP519: Web Programming Autumn 2015 COMP519: Web Programming Autumn 2015 In the next lectures you will learn What is SQL How to access mysql database How to create a basic mysql database How to use some basic queries How to use PHP and mysql

More information

Simple Quesries in SQL & Table Creation and Data Manipulation

Simple Quesries in SQL & Table Creation and Data Manipulation Simple Quesries in SQL & Table Creation and Data Manipulation Based on CBSE Curriculum Class -11 By- Neha Tyagi PGT CS KV 5 Jaipur II Shift Jaipur Region Neha Tyagi, PGT CS II Shift Jaipur Introduction

More information

2 PL/SQL - fundamentals Variables and Constants Operators SQL in PL/SQL Control structures... 7

2 PL/SQL - fundamentals Variables and Constants Operators SQL in PL/SQL Control structures... 7 Table of Contents Spis treści 1 Introduction 1 2 PLSQL - fundamentals 1 2.1 Variables and Constants............................ 2 2.2 Operators.................................... 5 2.3 SQL in PLSQL.................................

More information

Chapter 4. Basic SQL. Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley

Chapter 4. Basic SQL. Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 4 Basic SQL Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 4 Outline SQL Data Definition and Data Types Specifying Constraints in SQL Basic Retrieval Queries

More information

The Top 20 Design Tips

The Top 20 Design Tips The Top 20 Design Tips For MySQL Enterprise Data Architects Ronald Bradford COO PrimeBase Technologies April 2008 Presented Version By: 1.1 Ronald 10.Apr.2008 Bradford 1. Know Your Technology Tools Generics

More information

RDBMS-Day3. SQL Basic DDL statements DML statements Aggregate functions

RDBMS-Day3. SQL Basic DDL statements DML statements Aggregate functions RDBMS-Day3 SQL Basic DDL statements DML statements Aggregate functions SQL SQL is used to make a request to retrieve data from a Database. The DBMS processes the SQL request, retrieves the requested data

More information

Database-Aware Fault Localization for Dynamic Web Applications

Database-Aware Fault Localization for Dynamic Web Applications Database-Aware Fault Localization for Dynamic Web Applications Hung Viet Nguyen, Hoan Anh Nguyen, Tung Thanh Nguyen, Tien N. Nguyen Iowa State University ICSM 2013 Sep 22-28, 2013 Eindhoven, The Netherlands

More information

Course Outline. MySQL Database Administration & Design. Course Description: Pre-requisites: Course Content:

Course Outline. MySQL Database Administration & Design. Course Description: Pre-requisites: Course Content: MySQL Database Administration & Design Course Description: MySQL is the open source community's most popular Relational Database Management System (RDBMS) offering, and is a key part of LAMP - Linux, Apache,

More information

HOW TO CREATE AND MAINTAIN DATABASES AND TABLES. By S. Sabraz Nawaz Senior Lecturer in MIT FMC, SEUSL

HOW TO CREATE AND MAINTAIN DATABASES AND TABLES. By S. Sabraz Nawaz Senior Lecturer in MIT FMC, SEUSL HOW TO CREATE AND MAINTAIN DATABASES AND TABLES By S. Sabraz Nawaz Senior Lecturer in MIT FMC, SEUSL What is SQL? SQL (pronounced "ess-que-el") stands for Structured Query Language. SQL is used to communicate

More information

CET W/32 MySQL support module

CET W/32 MySQL support module CET W/32 MySQL support module REVISIONS Revision Date Changes Changed by 0.1 02/17/03 First Draft GK 0.2 02/18/03 Proofread and made minor syntax editing RG 0.3 02/21/03 Extended list of supported BASIC

More information

Read this before starting!

Read this before starting! Portion of test Points possible Written: 60 Code Modification: 20 Debug/Coding: 20 Total: 100 Points missed Points correct Student's Name: East Tennessee State University Department of Computer and Information

More information

MariaDB 10.3 vs MySQL 8.0. Tyler Duzan, Product Manager Percona

MariaDB 10.3 vs MySQL 8.0. Tyler Duzan, Product Manager Percona MariaDB 10.3 vs MySQL 8.0 Tyler Duzan, Product Manager Percona Who Am I? My name is Tyler Duzan Formerly an operations engineer for more than 12 years focused on security and automation Now a Product Manager

More information