Tag,
Hab ein update Problem, seh den Fehler aber nicht!
Fehlermeldung:
1064: You have an error in your SQL syntax near '(hostname, username, password, port, comment) = (192.168.1.100,furtwangen,ghb,21' at line 1
DB Aufbau
hostname, username, password = varchar
port = int
comment = varchar
Mfg Markus
Hab ein update Problem, seh den Fehler aber nicht!
Fehlermeldung:
1064: You have an error in your SQL syntax near '(hostname, username, password, port, comment) = (192.168.1.100,furtwangen,ghb,21' at line 1
DB Aufbau
hostname, username, password = varchar
port = int
comment = varchar
PHP-Code:
if(strlen($_POST['id']) == null || strlen($_POST['host']) == null || strlen($_POST['user']) == null || strlen($_POST['pass']) == null || strlen($_POST['port']) == null)
{
header ("Location: server.php");
}
else
{
if(strlen($_POST['comment']) == null)
{
echo "Hallo<br>";
$comment = $_POST['comment'];
$comment = "";
}
else
{
$comment = $_POST['comment'];
}
$hostname = addslashes($_POST['host']);
$username = addslashes($_POST['user']);
$password = addslashes($_POST['pass']);
$port = addslashes($_POST['port']);
$comment = addslashes($comment);
$sql = "UPDATE server SET (hostname, username, password, port, comment) = ($hostname,$username,$password,$port,$comment) WHERE id = $_POST[id]";
$update = mysql_query("$sql") or die(mysql_errno().": ".mysql_error());
}
Kommentar