|
|
|
|
|
|
| |
SQL stands for Structured Query Language.
MySQL runs on a server deamon where users on the same or even remote computers can connect.
Once connected you can select database if you have privileges to do so.
In this tutorial you will learn:
1. How to connect to MySQL.
2. Create a Table
3. Insert data in to you database.
4. Display database data in you browser.
5. Change data.
The Code:
Lets start off by connecting to MySQL: |
|
<?php
$location = "localhost";
$username = "username";
$password = "password";
$database = "database";
$conn = mysql_connect("$location","$username","$password");
if (!$conn) die ("Could not connect MySQL");
mysql_select_db($database,$conn) or die ("Could not open database");
?>
|
|
|
Read More... |
|
| |
| Beginners guide to PHP and MySQL Categories : PHP, Beginner Guides, Databases, MySQL, Installation | | | Beginners guide to PHP and MySQL - Creating a simple guest book Categories : Beginner Guides, To PHP, To MySQL, PHP, MySQL | | | Counting - Creating a simple counter Categories : PHP, MySQL, Beginner Guides, To PHP, To MySQL | | | How To add paging (Pagination) with PHP and MySQL Categories : PHP, Beginner Guides, Databases, MySQL, HTML and PHP | | | Counting - Creating a GIF based counter using PHP and MySQL Categories : Beginner Guides, PHP, To PHP, To MySQL, MySQL | | | Counting - Creating a more sophisticated GIF based counter using PHP and MySQL Categories : Beginner Guides, MySQL, PHP, To PHP, To MySQL | | | PHP 101 Part 8 of 15 : Databases and Other Animals Categories : PHP, Beginner Guides, Databases | | | Saving Images in MySQL Categories : MySQL, PHP, Graphics, Databases | | | Building A Persistent Shopping Cart With PHP and MySQL Categories : PHP, MySQL, Databases, Ecommerce | | | PHP 101 Part 9 of 15 : SQLite My Fire! Categories : PHP, Beginner Guides, Databases, SQLite | | | Referer Statistics Categories : PHP, MySQL, HTTP, Databases | | | Creating Users and Setting Permissions in MySQL Categories : Databases, MySQL | | | User identification using cookies in PHP and MySQL Categories : PHP, Databases, MySQL, Cookies | | | Custom MySQL-functions Categories : Databases, MySQL, PHP, PHP Functions | | | Multicolumn Output from a Database with PHP Categories : PHP, Databases, HTML and PHP, MySQL | |
| |
|
|