بهتره به فایل اتصال دیتابیس کد
if ($con->connect_error) {
die("Connection failed: " . $con->connect_error);
اضافه بشه برای بررسی اتصال