+ 2
How to connect to database in php7?
I can connect with the server but can't connect with mysql database. Could anyone share the syntax?
9 odpowiedzi
+ 8
mysqli_connect( host, login, pass, db );
+ 6
Google will help!
+ 3
Xan mysql unavailable in 7 version.
I offered MySQLi.
+ 3
perhaps, but those who used mysql , more convenient to use the mysqli module
+ 2
PDO is better than mysqli. More future proof.
https://code.tutsplus.com/tutorials/pdo-vs-mysqli-which-should-you-use--net-24059
+ 2
Xan I agree. beginners can PDO
+ 1
Use PDO, not mysql_connect().
http://php.net/manual/en/book.pdo.php
+ 1
True. However, a beginner might as well start learning PDO which works for any database system. It helps them learn a skill that is more prevalent and future proof. It's also a better system.
+ 1
Refer to W3school.com and tutorialspoint.com as both are great resources for this topic.