How do I link a database created on Wamp server to PHP?? | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 10

How do I link a database created on Wamp server to PHP??

7th Mar 2017, 10:21 AM
Baba Yunus Abdul Yekin
Baba Yunus Abdul Yekin - avatar
7 Antworten
+ 8
Use php predefined functions use for connectivity with databases, eg. mysqli_connect(); How to use- <?php $con = mysqli_connect("localhost","my_user","my_password","my_db"); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } ?>
7th Mar 2017, 11:22 AM
Sachin Artani
Sachin Artani - avatar
+ 8
I'm using mySQL and not mysqli
7th Mar 2017, 4:30 PM
Baba Yunus Abdul Yekin
Baba Yunus Abdul Yekin - avatar
+ 5
@abdul, So what? Now start using mysqli 😉 It's more easy as it takes everything ( needs for the connection) as in arguments.
7th Mar 2017, 6:40 PM
Sachin Artani
Sachin Artani - avatar
+ 4
For mysql use php functions mysql_connect() and mysql_select_db(); but I recommend you to use mysqli() because mysql is not supported in newer versions of php. See this code 👇👇👇👇 https://code.sololearn.com/wd9OJHt3Ml9d/?ref=app
17th Mar 2018, 12:09 PM
Jully Fredy
Jully Fredy - avatar
0
Firstly can you explain what way are you using, mysql? pdo? etc.
7th Mar 2017, 10:31 AM
Geoffrey L
Geoffrey L - avatar
0
good
14th Jan 2018, 10:32 AM
moamer abd alazeem
moamer abd alazeem - avatar
14th Jan 2018, 10:32 AM
moamer abd alazeem
moamer abd alazeem - avatar