title: Warning: mysql_connect(): php_network_getaddresses: getaddrinfo failed: No such host is known
body: <p>I'm trying to connect to a localhost database using php.</p>
  <p>but it's shown</p>
  <blockquote>
  <p>Warning: mysql_connect(): php_network_getaddresses: getaddrinfo failed: No such host is known. in C:\xampp2\htdocs\wikifiesto\wf-insertcase.php on line 7</p>
  <p>Warning: mysql_connect(): php_network_getaddresses: getaddrinfo failed: No such host is known. in C:\xampp2\htdocs\wikifiesto\wf-insertcase.php on line 7
  error connecting to database</p>
  </blockquote>
  <p>the structure of server, user, pass is localhost, pma, ' '</p>
  <p>here's my code with the name 'wf-insertcase.php':</p>
  <pre><code>&lt;?php
  define('dbuser', 'pma');
  define('dbpass', '');
  define('dbserver', 'localhost');
  define('dbname', 'wikifiesto');
  
  $conn = mysql_connect(dbuser, dbpass, dbserver, dbname);
  
  if (!$conn) {
      die('error connecting to database');
  }
  
  echo 'you have created case';
  ?&gt;
  </code></pre>