Chapter 6
I keep getting this error when attempting to add movies in chapter 6
Invalid query: Column count doesn't match value count at row 1
I think it is looking for a movie_id but i dont know, here is the commit page that sends it all to mysql for your viewing pleasure:
<?php
//COMMIT ADD
include "..\linkmov.php";
switch ($_GET['action']) {
case "add":
switch ($_GET['type']) {
case "movie":
$sql = "INSERT INTO movie
(movie_name,
movie_year,
movie_type,
movie_leadactor,
movie_director)
VALUES
('" . $_POST['movie_name'] . "'
'" . $_POST['movie_year'] . "'
'" . $_POST['movie_type'] . "'
'" . $_POST['movie_leadactor'] . "'
'" . $_POST['movie_director'] . "')";
break;
}
break;
}
if (isset($sql) && !empty($sql)) {
echo "";
$result = mysql_query($sql)
or die("Invalid query: " . mysql_error());
?>
<p align="center" style="color:#FF0000">
Done. <a href="index.php">Index</a>
</p>
<?php
}
?>
any help would be appreciated, Thanks
I'm getting kinda code
|