-1
MySQL 데이터베이스에 양식 값 제출. I 오류 메시지가 얻을 그러나 : 행에 문자열 변환문자열 변환에 대한 배열
이배열을 45
내가 가진 유일한 배열은 빈 필드를 잡는 $error
배열입니다. 이 같은 HTML 양식이있을 때
if(isset($_POST['submitted'])){
$errors = array(); // Initialize erroy array.
// Check for title.
if (empty($_POST['movie_name'])){
$errors[] = "You forgot to enter a title.";
} else {
$mn = (trim($_POST['movie_name']));
}
if (empty($_POST['leading_actor'])){
$errors[] = "You forgot to enter the leading actor.";
} else {
$la = (trim($_POST['leading_actor']));
}
if (empty($_POST['rating'])){
$errors[] = "Please select a rating.";
} else {
$rating = ($_POST['rating']);
}
if (empty($_POST['review'])){
$errors[] = "Please write a review";
} else {
$review = (trim($_POST['review']));
}
if (empty($errors)) { // If no errors were found.
//require_once('./includes/Mysql_connect.php');
// Make the insert query.
$query = "INSERT INTO film (movie_title, actor, fk_movie_ratings)
**This is line 45** Values ('$mn', '$la', '$rating')";
$result = mysql_query($query);
//Report errors.
} else {
foreach ($errors as $msg){
echo " - $msg <br/> ";
}
}
}
이 알림은 배열을 문자열로 처리 할 때 나타납니다. 45 행에있는 내용을 표시 할 수 있습니까? –
오류가 아니라 경고입니다. –