+ 10
How do I link a database created on Wamp server to PHP??
7 Respuestas
+ 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();
}
?>
+ 8
I'm using mySQL and not mysqli
+ 5
@abdul, So what? Now start using mysqli 😉 It's more easy as it takes everything ( needs for the connection) as in arguments.
+ 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
0
Firstly can you explain what way are you using, mysql? pdo? etc.
0
good