Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Connect To MySQL

DZone's Guide to

Connect To MySQL

·
Free Resource
// Connect to MySQL Database


//connect to your database ** EDIT REQUIRED HERE **
mysql_connect("localhost","username","password"); //(host, username, password)

//specify database ** EDIT REQUIRED HERE **
mysql_select_db("database") or die("Unable to select database"); //select which database we're using
Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}