ich meinte so, dass ich den code nich in die PHP datei muss einfügen.
nun habe ich ein kleineres anderes problem. das datum stimmt, aber die zeit ist immer 00:00:00. habe ich was falsch gemacht?
hier der scribt:
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
$timestamp = strftime("%Y%m%d",time());
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO Intranet_Mitteilung (Datum, Name, Mitteilung) VALUES ($timestamp, %s, %s)",
GetSQLValueString($_POST['Name'], "text"),
GetSQLValueString($_POST['Mitteilung'], "text"));
mysql_select_db($database_Paramed, $Paramed);
$Result1 = mysql_query($insertSQL, $Paramed) or die(mysql_error());
}
?>