Return to Snippet

Revision: 38009
at December 22, 2010 08:35 by inky76


Initial Code
<?php

$connection = mysql_connection('localhost','username','password');
// three parameters (server connection, username, password

//testing connection
//concatenates the mysql_error() call to the string
if(!$connection){
	die('error connection to database server'.mysql_error());
}
//checks to see if connected to proper database
if(!mysql_select_db('database_name',)){
	die('error connection to database');
}

?>



Initial URL


Initial Description


Initial Title
Creating PHP Connection to MySQL Table

Initial Tags
mysql, php

Initial Language
PHP