+ 2
Does any one has a less complicated way of connecting to the Database?
for some reason my code has refused to connect to my Database or produce any error message https://code.sololearn.com/wuBeiXqUSydD/?ref=app
6 Antworten
+ 9
This is how I connect with the Database using MySQLi:
<?php
$connection = mysqli_connect('localhost', 'root', ' ', 'my_db');
/*
PHP codes here
*/
?>
+ 5
Make sure you have input the correct database name, user and password.
+ 4
Put sql connection means table name.
+ 3
Thanks Domino
It works fine for me ☺
+ 2
Thanks I've done that
but it doesn't still connect or give me an error message even when I put the wrong details on purpose
is there any easier way to connect to my Database?
+ 2
You probably won't be able to connect to any database here on sololearn (even to a non-localhost one) because of security reasons. This is also why you can't send mails with php or use webstorage API with JS.