WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDES  |  PHP CLASSES  |  CODE SEARCH  |  ARTICLES SEARCH  |  PHP FORUMS  |  PHP MANUAL  |  PHP FUNCTIONS LIST  |  WEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Submit Your Code
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
WeberDev's Monthly code contest PHP Code Contest
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Index
Web Development Resources
Web Development Content
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
Mobile Dev World

Go Back Add a Comment Send this Article to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES SUBMIT AN ARTICLE PRINT
Title : Start Using MySQL
Categories : MySQL, Databases, To MySQL, Beginner Guides
phpfreaks.com
phpfreaks.com
Date : 2002-08-28
Grade : 1 of 5 (graded 1 times)
Viewed : 19432
Search : More Articles by phpfreaks.com
Action : Grade This Article
Tools : My Favotite Articles


  Submit your own code examples 
 


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 - Creating a simple guest book
Categories : Beginner Guides, To PHP, To MySQL, PHP, MySQL
How To add paging (Pagination) with PHP and MySQL
Categories : PHP, Beginner Guides, Databases, MySQL, HTML and PHP
Counting - Creating a simple counter
Categories : PHP, MySQL, Beginner Guides, To PHP, To MySQL
Beginners guide to PHP and MySQL
Categories : PHP, Beginner Guides, Databases, MySQL, Installation
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, MySQL and Authentication 101
Categories : PHP, Databases, MySQL, Authentication
Building A Persistent Shopping Cart With PHP and MySQL
Categories : PHP, MySQL, Databases, Ecommerce
Speaking SQL part 2
Categories : General SQL, Databases, MySQL
How Logs Work On MySQL With InnoDB Tables
Categories : Databases, MySQL, InnoDB
Managing Foreign Key Relationships In MySQL Using SQLyog
Categories : Databases, MySQL, SQLyog
Creating Users and Setting Permissions in MySQL
Categories : Databases, MySQL
Miles To Go Before I Sleep...
Categories : PHP, Calendar, Databases, MySQL
Alternating row colors with PHP and mySQL
Categories : PHP, Databases, MySQL, HTML and PHP
Multicolumn Output from a Database with PHP
Categories : PHP, Databases, HTML and PHP, MySQL