C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Articles » Databases »

Connecting MySQL database through PHP


Posted Date: 13 Aug 2008    Resource Type: Articles    Category: Databases
Author: Amol Nirmala WamanMember Level: Bronze    
Rating: 1 out of 5Points: 10



Connecting MySQL5 database through PHP5 is very simple and clean.

1. Create a database with name 'test'
2. Create 'books' table in 'test' database
3. Add three columns 'authorid', 'title', 'author'
4. Create a simple 'demo.php' file
5. Add the following code in 'demo.php'



$hostname = "localhost";
$username = "username";
$password = "password"
$database = "test";

$db_connect = mysql_connect("localhost","username","password");
if (!$db_connect)
{
die(mysql_error());
}

?>



Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
Web  .  SQL Database to php  .  SQL Database  .  PHP  .  MySQL  .  Database  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Joins in SQL server
Previous Resource: Date and Time data types in SQL Server 2008
Return to Discussion Resource Index
Post New Resource
Category: Databases


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use