Warning: mysqli_select_db() expects Exactly 2 Parameters (did not find answer in the other topics)

Asked

Viewed 26 times

0

I’m new to this programming business so I’m kind of stuck in this code, so I’d appreciate it if someone could help me.

The following warning appears:

Warning: mysqli_select_db() expects Exactly 2 Parameters, 1 Given in C: xampp htdocs cadadmin Adm connection.php on line 3 Base no found

The code:

<?php
  $conectar = mysqli_connect("localhost","root","", "tcc") or die ("Erro na 
  conexão");
  mysqli_select_db("tcc")or die ("Base não encontrada");
?>
  • In procedural style you must provide the parameter $link, which in your case is $conectar, see how it looks: mysqli_select_db($conectar, "tcc"); ... To learn more, read documentation.

  • 1

    I managed doing just that, just before I saw your comment. But thank you so much anyway!

  • Very well, as the problem was solved I opened a vote to have the question closed due to typo. Welcome to community, if possible do the Tour to find out how things work around here.

  • Okay. Thank you very much

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.