Why does it always insert something in the Mysql table, if i fill in nothing on the html website.
My code:
if($message =! ""){
$result = mysql_query("INSERT INTO Blog (Inhalt) VALUES ('$message')");}
Why does it always insert something in the Mysql table, if i fill in nothing on the html website.
My code:
if($message =! ""){
$result = mysql_query("INSERT INTO Blog (Inhalt) VALUES ('$message')");}
You have made a mistake: should be != "" but not a =! ""
Use :
if($message != ""){
$result = mysql_query("INSERT INTO Blog (Inhalt) VALUES ('$message')");
}
OR:
if($message){
$result = mysql_query("INSERT INTO Blog (Inhalt) VALUES ('$message')");
}