How to connect server? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to connect server?

28th Jun 2017, 12:09 PM
swapnil gaikwad
swapnil gaikwad - avatar
3 Answers
+ 2
Depends what you're talking about. If you're trying to log directly into your server so you can change things, you may want to use something like phpMyAdmin, which is a nice web interface for your database server. If you're talking about from your code, then you can do this via PHP: <?php define('DB_NAME', 'databaseName'); define('DB_USER', 'root'); define('DB_PASSWORD', 'yourPassword'); define('DB_HOST', 'localhost'); $databaseConnection = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); if ($databaseConnection->connect_error) { die("Database selection failed: " . $databaseConnection->connect_error); } ?> That's just an example. You're really vague with what you're asking, and didn't provide what you're actually using, so it's hard to answer specifically. If you want to clarify, I'll be more than happy to assist.
28th Jun 2017, 12:41 PM
AgentSmith
+ 1
thanks
1st Jul 2017, 1:58 AM
swapnil gaikwad
swapnil gaikwad - avatar
0
database server
1st Jul 2017, 2:02 PM
Kumar Rahul
Kumar Rahul - avatar