php结合MySQL操作是现在的网站平台的基本配置。这里就讲一下用php进行MySQL的基本操作。
$username = "username"; $password = "password"; $db_name = "db_name"; $link = mysql_connect('localhost', $username, $password); if (!$link) { die('Could not connect: ' . mysql_error()); } mysql_select_db($db_name); mysql_query('set names "utf8"'); #编码设置