Page 1 of 1

mysql not sending

Posted: Tue Oct 11, 2005 12:41 am
by paqman
This code isn't sending the data to the table, but no error shows and it still echo's.

Code: Select all

if($cmd == "submit") {

$title = $_POST["title"];
$system = $_POST["system"];
$subsystem = $_POST["subsystem"];
$username = $_POST["username"];
$image = $_POST["image"];
$ext = $_POST["ext"];
$link = $_POST["link"];
$rate1 = $_POST["rate1"];
$rate2 = $_POST["rate2"];
$rate3 = $_POST["rate3"];
$rate4 = $_POST["rate4"];
$rating1 = $_POST["rating1"];
$rating2 = $_POST["rating2"];
$rating3 = $_POST["rating3"];
$rating4 = $_POST["rating4"];
$comment1 = $_POST["comment1"];
$comment2 = $_POST["comment2"];
$comment3 = $_POST["comment3"];
$comment4 = $_POST["comment4"];
$finalcomment = $_POST["finalcomment"];

$submittodatabase=MYSQL_QUERY("INSERT INTO review (id,title,subsystem,username,image,ext,link,rate1,rate2,rate3,rate4,rating1,rating2,rating3,rating4,comment1,comment2,comment3,comment4,finalcomment)".
"VALUES ('NULL', '$title', '$system', '$subsystem', '$username', '$image', '$ext', '$link', '$rate1', '$rate2', '$rate3', '$rate4', '$rating1', '$rating2', '$rating3', '$rating4', '$comment1', '$comment2', '$comment3', '$comment4', '$finalcomment')");

echo "Thank you $c_name for submitting a review. To view it, <a href=\"index.php?id=reviews&cmd=view&title=$title&subsystem=$subsystem\">Click Here</a>.";

}
Did I type something in wrong? Thanks!!!

Posted: Tue Oct 11, 2005 12:46 am
by feyd
no error shows because you aren't detecting for errors to happen:

Code: Select all

$query = mysql_query($sql) or die(mysql_error());

Posted: Tue Oct 11, 2005 12:53 am
by paqman
Column count doesn't match value count at row 1

Posted: Tue Oct 11, 2005 12:57 am
by paqman
sorry i just figured it out, don't bother replying. I missed 'system' in the first part. thanks for the help

Posted: Tue Oct 11, 2005 12:58 am
by feyd
you don't have a matching column name for $system