0
Please i need help to connect to database using xampp and php...
<?php mysql_connect('localhost', 'root', ''); mysql_select_db ('') ?> if I use this to connect it does not work. please what might be the problem... and if there is any other way to connect, please help..
8 Respostas
+ 6
Make sure MySQL is up and running on localhost.
+ 6
You do not have the required extension. Uncomment the line extension=php_mysql.dll in your "php.ini" file and restart XAMPP.
+ 4
What error do you get?
0
it is running but still can't connect
0
Fatal error: Uncaught Error:Call to undefined function mysql_connect() in C:\xampp\htdocs\php\connect.php:6 Stack trace:#0 {main} thrown in C:\xampp\htdocs\php\connect.php on line 6.
this is the whole error msg
0
use mysqli query
<?php
$con=mysqli_connect("localhost","my_user","my_password","my_db");
// Check connection
if (mysqli_connect_error())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
0
fjcf
0
cnef