Mysql

  • November 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Mysql as PDF for free.

More details

  • Words: 165
  • Pages: 8
Your datasource

MySQL is a database. A database defines a structure for storing information.  In a database, there are tables. Just like HTML tables, database tables contain rows, columns, and cells.  Databases are useful when storing information categorically. A company may have a database with the following tables: "Employees", "Products", "Customers" and "Orders". 

$con = mysql_connect(servername, username, password);  mysql_close($con); 



A database must be selected before a table can be created. The database is selected with the mysql_select_db() function.  mysql_select_db("my_db", $con); 

To get PHP to execute an SQL statement we must use the mysql_query() function.  $result = mysql_query("SELECT * FROM person"); 

Use mysql_fetch_array() function to get the query result as an array.  $result = mysql_query(‘SELECT * FROM person’);  while($row = mysql_fetch_array($result)) { echo $row['FirstName'] . " " . $row['LastName']; echo "
"; } 

Related Documents

Mysql
November 2019 51
Mysql
November 2019 43
Mysql
June 2020 24
Mysql
October 2019 45
Mysql
June 2020 25
Mysql
May 2020 25