title: Warning: mysqli_select_db() expects exactly 2 parameters, 1 given in
body: <p>im a beginner and also a diploma student... i have created database using localhost... im having problem viewing my database... please help me... i hope u can help me with a full code... this is the ERROR...</p>
  
  <pre><code>Warning: mysqli_select_db() expects exactly 2 parameters, 1 given in C:\xampp\htdocs\SLR\View S110 PC01.php on line 10
  cannot select DB
  </code></pre>
  
  <p>this is my code...</p>
  
  <pre><code>&lt;?php
  $host="localhost"; // Host name 
  $username="root"; // Mysql username 
  $password=""; // Mysql password 
  $db_name="slr"; // Database name 
  $tbl_name="s110_pc01"; // Table name 
  
  // Connect to server and select databse.
  mysqli_connect("$host", "$username", "$password")or die("cannot connect"); 
  mysqli_select_db("$db_name")or die("cannot select DB");
  
  $sql="SELECT * FROM $tbl_name";
  $result=mysqli_query($sql);
  
  $count=mysqli_num_rows($result);
  ?&gt;
  
  &lt;table width="400" border="0" cellspacing="1" cellpadding="0"&gt;
  &lt;tr&gt;
  &lt;td&gt;&lt;form name="form1" method="post" action=""&gt;
  &lt;table width="400" border="0" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC"&gt;
  &lt;tr&gt;
  &lt;td bgcolor="#FFFFFF"&gt;&amp;nbsp;&lt;/td&gt;
  &lt;td colspan="4" bgcolor="#FFFFFF"&gt;&lt;strong&gt;Delete multiple rows in mysql&lt;/strong&gt; &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td align="center" bgcolor="#FFFFFF"&gt;#&lt;/td&gt;
  &lt;td align="center" bgcolor="#FFFFFF"&gt;&lt;strong&gt;Software ID&lt;/strong&gt;&lt;/td&gt;
  &lt;td align="center" bgcolor="#FFFFFF"&gt;&lt;strong&gt;Software Name&lt;/strong&gt;&lt;/td&gt;
  &lt;td align="center" bgcolor="#FFFFFF"&gt;&lt;strong&gt;Installed Date&lt;/strong&gt;&lt;/td&gt;
  &lt;td align="center" bgcolor="#FFFFFF"&gt;&lt;strong&gt;Expiry Date&lt;/strong&gt;&lt;/td&gt;
  &lt;td align="center" bgcolor="#FFFFFF"&gt;&lt;strong&gt;Product Key&lt;/strong&gt;&lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;?php
  while($rows=mysqli_fetch_array($result)){
  ?&gt;
  
  &lt;tr&gt;
  &lt;td align="center" bgcolor="#FFFFFF"&gt;&lt;input name="checkbox[]" type="checkbox" id="checkbox[]" value="&lt;? echo $rows['id']; ?&gt;"&gt;&lt;/td&gt;
  &lt;td bgcolor="#FFFFFF"&gt;&lt;? echo $rows['soft_id']; ?&gt;&lt;/td&gt;
  &lt;td bgcolor="#FFFFFF"&gt;&lt;? echo $rows['soft_name']; ?&gt;&lt;/td&gt;
  &lt;td bgcolor="#FFFFFF"&gt;&lt;? echo $rows['installed_date']; ?&gt;&lt;/td&gt;
  &lt;td bgcolor="#FFFFFF"&gt;&lt;? echo $rows['expiry_date']; ?&gt;&lt;/td&gt;
  &lt;td bgcolor="#FFFFFF"&gt;&lt;? echo $rows['product_key']; ?&gt;&lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;?php
  }
  ?&gt;
  
  &lt;tr&gt;
  &lt;td colspan="5" align="center" bgcolor="#FFFFFF"&gt;&lt;input name="delete" type="submit" id="delete" value="Delete"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;?php
  
  // Check if delete button active, start this 
  if($delete){
  for($i=0;$i&lt;$count;$i++){
  $del_id = $checkbox[$i];
  $sql = "DELETE FROM $tbl_name WHERE soft_id='$soft_id'";
  $result = mysqli_query($sql);
  }
  // if successful redirect to delete_multiple.php 
  if($result){
  echo "&lt;meta http-equiv=\"refresh\" content=\"0;URL=View S110 PC01.php\"&gt;";
  }
  }
  mysqli_close();
  ?&gt;
  
  &lt;/table&gt;
  &lt;/form&gt;
  &lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>