I get everytime Error 500. I tried to comment everything but nothing won't help. Where could be the problem? I use a normal apache2 server on Ubuntu. Even if I write the beginning tag like
<?php
error_reporting(E_ALL);
mysql_connect("192.168.3.64", "root", "xxx");
mysql_select_db("vertretung");
function rollback_if_error() {
if(mysql_error()) {
mysql_query("ROLLBACK");
die("error");
}
}
mysql_query("START TRANSACTION");
$table_id = rand();
mysql_query("INSERT INTO tables (table_id, table_date, table_name) VALUES ($table_id, '".mysql_real_escape_string($_POST['table_date'])."', '".mysql_real_escape_string($_POST['table_name'])."')");
rollback_if_error();
$table_rows = explode("|", $_POST['table_data']);
$is_caption = true;
foreach($table_rows as $row) {
$row_id = rand();
mysql_query("INSERT INTO table_rows (row_id, table_id, is_caption) VALUES ($row_id, $table_id, ".$is_caption.")");
rollback_if_error();
$fields = explode(";", $row);
foreach($row as $field) {
mysql_query("INSERT INTO table_field (row_id, value) VALUES ($row_id, '".mysql_real_escape_string($field)."')");
rollback_if_error();
}
$is_caption = false;
}
mysql_query("COMMIT");
?>