, mysqli_prepare(), .
, , , ( , .. PHP ).
MySQL, .
edit: , desc - .
( ) . http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html
$q = '
INSERT INTO
`event`
(
`cityid`, `name`, `desc`, `date`,
`expdate`, `mintix`, `maxtix`,
`contactname`, `contactemail`, `contactphone`
)
VALUES
(
?,?,?,?,
?,?,?,
?,?,?
)
';
if ( false===($stmt=mysqli_prepare($dblink, $q)) ) {
die('mysqli_prepare failed: '.htmlspecialchars(mysqli_error($dblink)));
}
$rc = mysqli_stmt_bind_param(
$stmt,
"issssiisss",
$city,$name,$desc,$date,
$expdate,$mintix,$maxtix,
$contactname,$contactemail,$contactphone
);
if ( false===$rc ) {
die('mysqli_stmt_bind_param failed: '.htmlspecialchars(mysqli_stmt_error($stmt)));
}
if ( false===mysqli_stmt_execute($stmt) ) {
die('mysqli_stmt_execute failed: '.htmlspecialchars(mysqli_stmt_error($stmt)));
}
mysqli_stmt_close($stmt);