Php connectivitywithmysql
-
Upload
bhumivaghasiya -
Category
Education
-
view
80 -
download
0
description
Transcript of Php connectivitywithmysql
![Page 1: Php connectivitywithmysql](https://reader036.fdocuments.net/reader036/viewer/2022062405/556174e4d8b42a72118b4c15/html5/thumbnails/1.jpg)
11-Sep-2014Thursday
Connectivity With MySQL
![Page 2: Php connectivitywithmysql](https://reader036.fdocuments.net/reader036/viewer/2022062405/556174e4d8b42a72118b4c15/html5/thumbnails/2.jpg)
• Introduction• What is MySQL• Create Database• Basic MySQL Operations• Basic MySQL Functions• Benefits• Drawbacks• Conclusion
Points of Discussion2
![Page 3: Php connectivitywithmysql](https://reader036.fdocuments.net/reader036/viewer/2022062405/556174e4d8b42a72118b4c15/html5/thumbnails/3.jpg)
Introduction3
• A database is an application that manages data and allows fast storage and retrieval of that data.
A database is a collection of information that is organized so that it can easily be accessed, managed, and updated.
![Page 4: Php connectivitywithmysql](https://reader036.fdocuments.net/reader036/viewer/2022062405/556174e4d8b42a72118b4c15/html5/thumbnails/4.jpg)
Example of Database
• Sql Server
• Oracle• FoxPro• MongoDB• Microsoft Access
4
MySQL
![Page 5: Php connectivitywithmysql](https://reader036.fdocuments.net/reader036/viewer/2022062405/556174e4d8b42a72118b4c15/html5/thumbnails/5.jpg)
What is MySql
MySQL
![Page 6: Php connectivitywithmysql](https://reader036.fdocuments.net/reader036/viewer/2022062405/556174e4d8b42a72118b4c15/html5/thumbnails/6.jpg)
MySql6
• MySQL is a database.
• The data in MySQL is stored in database objects called tables.
• A table is a collections of related data entries and it consists of columns and rows.
• Databases are useful when storing information categorically.
![Page 7: Php connectivitywithmysql](https://reader036.fdocuments.net/reader036/viewer/2022062405/556174e4d8b42a72118b4c15/html5/thumbnails/7.jpg)
Continue
• Download MySQL Database
• If you don't have a PHP server with a MySQL Database, you can download MySQL for free here:
•
http://www.mysql.com/downloads/index.html
7
![Page 8: Php connectivitywithmysql](https://reader036.fdocuments.net/reader036/viewer/2022062405/556174e4d8b42a72118b4c15/html5/thumbnails/8.jpg)
Continue
• MySQL works on many operating systems and with many languages including PHP, PERL, C, C++, JAVA etc.
• MySQL is very friendly to PHP, the most appreciated language for web development.
8
![Page 9: Php connectivitywithmysql](https://reader036.fdocuments.net/reader036/viewer/2022062405/556174e4d8b42a72118b4c15/html5/thumbnails/9.jpg)
How to Create Database?
MySQL
![Page 10: Php connectivitywithmysql](https://reader036.fdocuments.net/reader036/viewer/2022062405/556174e4d8b42a72118b4c15/html5/thumbnails/10.jpg)
How to Create Database10
![Page 11: Php connectivitywithmysql](https://reader036.fdocuments.net/reader036/viewer/2022062405/556174e4d8b42a72118b4c15/html5/thumbnails/11.jpg)
Give Database Name11
![Page 12: Php connectivitywithmysql](https://reader036.fdocuments.net/reader036/viewer/2022062405/556174e4d8b42a72118b4c15/html5/thumbnails/12.jpg)
Give Table Name & No of Columns
12
![Page 13: Php connectivitywithmysql](https://reader036.fdocuments.net/reader036/viewer/2022062405/556174e4d8b42a72118b4c15/html5/thumbnails/13.jpg)
Field Name13
![Page 14: Php connectivitywithmysql](https://reader036.fdocuments.net/reader036/viewer/2022062405/556174e4d8b42a72118b4c15/html5/thumbnails/14.jpg)
Table Created14
![Page 15: Php connectivitywithmysql](https://reader036.fdocuments.net/reader036/viewer/2022062405/556174e4d8b42a72118b4c15/html5/thumbnails/15.jpg)
Structure of Table15
![Page 16: Php connectivitywithmysql](https://reader036.fdocuments.net/reader036/viewer/2022062405/556174e4d8b42a72118b4c15/html5/thumbnails/16.jpg)
Basic MySQL
Operation
MySQL
![Page 17: Php connectivitywithmysql](https://reader036.fdocuments.net/reader036/viewer/2022062405/556174e4d8b42a72118b4c15/html5/thumbnails/17.jpg)
Basic Operations
• Create table• Insert records• Retrieve records• Update records• Delete records• Modify table• Join table• Drop table
17
![Page 18: Php connectivitywithmysql](https://reader036.fdocuments.net/reader036/viewer/2022062405/556174e4d8b42a72118b4c15/html5/thumbnails/18.jpg)
Basic MySQLFunctions
MySQL
![Page 19: Php connectivitywithmysql](https://reader036.fdocuments.net/reader036/viewer/2022062405/556174e4d8b42a72118b4c15/html5/thumbnails/19.jpg)
Basic MySQL Functions
• mysql_connect()• mysql_select_db()• mysql_query()• mysql_featch_row()• mysql_featch_array()• mysql_affected_row()• Mysql_close()
19
![Page 20: Php connectivitywithmysql](https://reader036.fdocuments.net/reader036/viewer/2022062405/556174e4d8b42a72118b4c15/html5/thumbnails/20.jpg)
Mysql_connect()
• Purpose:-»This Function is used to connect
your application with database.
• Syntax:-
20
Bool mysql_connect(“servarname”,”username”,”password”);
![Page 21: Php connectivitywithmysql](https://reader036.fdocuments.net/reader036/viewer/2022062405/556174e4d8b42a72118b4c15/html5/thumbnails/21.jpg)
Mysql_select_db()
• Purpose:-»This Function is used to select
particular database from phpmyadmin database.
• Syntax:-
21
bool mysql_select_db(“Databse Name”);
![Page 22: Php connectivitywithmysql](https://reader036.fdocuments.net/reader036/viewer/2022062405/556174e4d8b42a72118b4c15/html5/thumbnails/22.jpg)
Mysql_query()
• Purpose:-» Sends the specified SQL query to
the database specified by the resource identifier. The retrieved data are returned by the function as a MySQL result set.
• Syntax:-
22
Record set mysql_query(“sqlquery”);
![Page 23: Php connectivitywithmysql](https://reader036.fdocuments.net/reader036/viewer/2022062405/556174e4d8b42a72118b4c15/html5/thumbnails/23.jpg)
Benefits
MySQL
![Page 24: Php connectivitywithmysql](https://reader036.fdocuments.net/reader036/viewer/2022062405/556174e4d8b42a72118b4c15/html5/thumbnails/24.jpg)
Benefits
• Open Source
• Easy, Fast and High Performing
• Cross Platform Supports
• Occupies very less disk space.
24
![Page 25: Php connectivitywithmysql](https://reader036.fdocuments.net/reader036/viewer/2022062405/556174e4d8b42a72118b4c15/html5/thumbnails/25.jpg)
Drawbacks
MySQL
![Page 26: Php connectivitywithmysql](https://reader036.fdocuments.net/reader036/viewer/2022062405/556174e4d8b42a72118b4c15/html5/thumbnails/26.jpg)
Drawbacks
• Developers accuse MySQL for not having a good developing and debugging tool compared to paid databases.
• MySQL cannot work efficiently with large databases.
26
![Page 27: Php connectivitywithmysql](https://reader036.fdocuments.net/reader036/viewer/2022062405/556174e4d8b42a72118b4c15/html5/thumbnails/27.jpg)
Conclusion
MySql is an Open Source database Management System and Support Major features of the
RDBMS.
There is no need of Purchase any other thing, we have to just install and done.
27
![Page 28: Php connectivitywithmysql](https://reader036.fdocuments.net/reader036/viewer/2022062405/556174e4d8b42a72118b4c15/html5/thumbnails/28.jpg)
Demo
MySQL
![Page 29: Php connectivitywithmysql](https://reader036.fdocuments.net/reader036/viewer/2022062405/556174e4d8b42a72118b4c15/html5/thumbnails/29.jpg)
Reference
www.mysql.com www.slideshare.com www. Wikipedia.com
29
![Page 30: Php connectivitywithmysql](https://reader036.fdocuments.net/reader036/viewer/2022062405/556174e4d8b42a72118b4c15/html5/thumbnails/30.jpg)
That’s All for PHP With
MySQLThank You…!!!
MySQL