2015-10-29 75 views
0

我在問了上一個問題後修復了我的代碼,但現在我在標題中提到了錯誤行。那麼這裏的代碼,這樣你就可以找出或至少有助於將已瞭解的問題是什麼:mysql_connection問題 - 'getaddrinfo失敗','沒有這樣的主機是已知的'?

<html> 
<head> 
<title>test3</title> 
</head> 
<body> 
<?php 
$verbindung = mysql_connect("localhost, vanille") 
or die ("Fehler"); 

mysql_select_db("test3") 
or die ("Verbindung nicht möglich..."); 

$datum = $_POST["datum"]; 
$autor = $_POST["autor"]; 
$newstext = $_POST["newstext"]; 

if($datum == "" or $autor == "" or $newstext == "") { 
echo "FAIL"; 
} else { 

$eintrag = "INSERT INTO test3 
(datum, autor, newstext) 

VALUES 
('$datum', '$autor', '$newstext')"; 

} 

mysql_close($verbindung); 
?> 
</body>        
</html> 

回答

2

只是給定的代碼

<html> 
<head> 
<title>test3</title> 
</head> 
<body> 
<?php 
$verbindung = mysql_connect("localhost","vanille") 
or die ("Fehler"); 

mysql_select_db("test3") 
or die ("Verbindung nicht möglich..."); 

$datum = $_POST["datum"]; 
$autor = $_POST["autor"]; 
$newstext = $_POST["newstext"]; 

if($datum == "" or $autor == "" or $newstext == "") { 
echo "FAIL"; 
} else { 

$eintrag = "INSERT INTO test3 
(datum, autor, newstext) 

VALUES 
('$datum', '$autor', '$newstext')"; 

} 

mysql_close($verbindung); 
?> 
</body>        
</html> 
+0

好吧,我會嘗試了這一點替換您的代碼 – DarkYagami

相關問題