Skip to content

Instantly share code, notes, and snippets.

@mayukojpn
Created December 23, 2014 09:46
Show Gist options
  • Save mayukojpn/44d1cf353b42222c8d65 to your computer and use it in GitHub Desktop.
Save mayukojpn/44d1cf353b42222c8d65 to your computer and use it in GitHub Desktop.
PHP から MySQL に接続してみるテスト
<html>
<head><title>MySQL Connection</title></head>
<body>
<?php
$link = mysql_connect('server','user_name','user_pass');
if (!$link) {
die('failed'.mysql_error());
}
print('<p>connection succeed!</p>');
$close_flag = mysql_close($link);
if ($close_flag){
print('<p>Closing succeed.</p>');
}
?>
</body>
</html>
~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment