Hello guys i have question how is the right way to write the mysqli_connect ?

$con=mysqli_connect("username","host","password","db_name");

Please tell me if im wrong and how to fix it.
Thanks ! :)

Recommended Answers

All 3 Replies

The parameters order is:

  • host
  • username
  • password
  • database name
  • port
  • socket

Last two are optional, so:

mysqli_connect("host","username","password","db_name");

Docs:

Ok thank you but now the problem is i dont know my "host" i have Database in godaddy, can anyone tellme how to find it ?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.