+ 2
Php sql big data how to import sql database
plz help the question
3 Réponses
+ 7
Generally it is included in your webServer, in linux you can type:
> sudo apt-get install mysql-server php5-mysql
... latest Php version requires php7.0-mysql rather than php5-mysql.
... Open a connection:
$conn = new mysqli(servername, username, password, database);
• servername generally is 'localhost'
• username generally is 'root'
• password is the password specified when you installed mySql
• database is your database connection, if you have not databases, skip this step.
For more informations and also more approaches (modular, PDO) take the W3schools course for free: https://goo.gl/AWj6x1
Note: It is a good practice follow an OOP approach rather than the (most popular) modular approach. :)
+ 6
copy this code, it's your answer ;)
read before copy it, there are 2 ways, I write both ;)
https://code.sololearn.com/wq31DaowT6uF/?ref=app
0
php in sololearn dont see mysqli(), so there is a problem with connection