REVIEWS


Article May 2011
Question:
How do I Connect a website in MySql?

Answer:
If you want to connect your website to a MySQL database. There are a number of steps.

    You must make sure your hosting company offers that service and that you have that feature on your current hosting account. You must create the database with a user name and password. You can manipulate your database(s) using a program called phpMyAdmin. This is usually provided by your host company. Youmust use a scripting language to connect with. Usually of you are using MySQL then the language will be PHP.
    You then create the php page and upload it up to your sever. The following sample will allow you to connect your php page to the database. It does NOT do anything else other than connect. There are too many other variables on the type of table created and what you may want to do to show a general example.

Example:

<?php

//Usually this is localhost. But could be an address of the database server
$HostType = "locahost";

//Name of your database
$DatabaseName = "SomeName";

//Your database username
$DbaseUsername = "SomeUsername";

//Your database password
$DbasePassword = "SomePassword";

$db=mysql_connect($HostType,$DbaseUsername,$DbasePassword);
mysql_select_db($DatabaseName,$db) or die ("cant change");


//code to manipulate the data base

?>
source:ComputerGeek
Copyright © 2009-2011 Dacharti Corp. All Rights Reserved.
Home            About Us            Article            FAQ            Contacs
www.dacharti.tk
Computer Management
--Daniel Tiwow, Author

Computer Content on Site
--Daniel Tiwow, Author