tags:

views:

43

answers:

3

What does the following mean when displayed on the screen?

And what are some solutions to correct it?

Column count doesn't match value count at row 1

Code I think is giving me a problem.

$query2 = "INSERT INTO question_tags (tag_id, users_questions_id) VALUES ('$id',(SELECT id FROM tags WHERE tag='" . $tags[$x] . "'), '$page')";

I removed the $id and now I get the following error.

Column 'tag_id' cannot be null
+2  A: 

In your query you are specifying 2 columns in the columnslist but then providing 3 values in the value list. Either provide a third column name or remove on the values.

Vincent Ramdhanie
A: 

Your column list (tag_id, users_questions_id) has two items. Your values list ('$id',(SELECT id FROM tags WHERE tag='" . $tags[$x] . "'), '$page') has three.

Ewan Todd