<?php
function getMysqlConnection($host,$user,$pass,$database){
global $mysqli;
global $Mysqlerror;
$mysqli = new mysqli('$host','$user','$pass','$database');
if(empty($mysqli->connect_errorno) == false){
$Mysqlerror = "true";
}else{
$Mysqlerror = "false";
} }
?>
Ben bir işlevi oluşturduk ve ben yanlış şifre kullanılmış ve Mysqlerror olduğunu kullanıcı adı rağmenMySQL hatası
<?php
require 'myFunc.php';
getMysqlConnection("localhost", "wronguser","wrongpass" ," test");
echo $Mysqlerror;
?>
kullanarak bu fonksiyonu hayata yanlış . Ben de kullanılmış veya işlev hiçbir şey her zamanki gibi lampp yeniden
Warning: mysqli::mysqli(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /opt/lampp/htdocs/mysite/myFunc.php on line 5
Warning: mysqli::mysqli(): (HY000/2002): php_network_getaddresses: getaddrinfo failed: Name or service not known in /opt/lampp/htdocs/mysite/myFunc.php on line 5
gerçekleşmesi die o
Starting XAMPP for Linux 1.8.0...
XAMPP: Starting Apache with SSL (and PHP5)...
XAMPP: Starting MySQL...
Warning: World-writable config file '/opt/lampp/etc/my.cnf' is ignored
XAMPP: Starting ProFTPD...
/opt/lampp/share/lampp/alladdons: line 23: /opt/lampp/share/addons/: is a directory
XAMPP for Linux started.
bazı şey benim koduyla ya da benim sunucu ile sorun var mı
gösterdi. Nasıl düzeltilir?
verdiyse $ Mysqlerror'u geri çevirmek için kullandım – gokul