Insert value list does not match column list: 1136 Column count doesn't match value count

Your database table has 35 columns

id_logged, patient_id, one, two, three, four, five, six, seven, eight, nine, ten, eleven, twelve, thirteen, fourteen, fifteen, sixteen, seventeen, eightteen, nineteen, twenty, twone, twtwo, twthree, twfour, twfive, twsix, twseven, tweight, twnine, thirty, thone, thtwo, date_now

Where as the values you are passing are 34 columns

VALUES (:id_logged, :patient_id, :one, :two, :three, :four, :five, :six, :seven, :eight, :nine, :ten, :eleven, :twelve, :thirteen,
        :fourteen, :fifteen, :sixteen, :lone, :ltwo, :lthree, :lfour, :lfive, :lsix, :lseven, :leight, :lnine, :lten, :leleven, :ltwelve, :lthirteen, :lfourteen, :lfifteen, :lsixteen)

This mismatch of columns is giving you the error.

You forgot to pass the value for date_now column. once you pass it error will be resolved


SQLSTATE[21S01]: Insert value list does not match column list: 1136 Column count doesn't match value count at row 1

The previous answer absolutely explains the underlying problem but maybe it is helpful to understand the error report as well. It is in two parts:

Insert value list does not match column list: the SQL statement consists of first a list of columns then a list of values, these two do not match.

1136 Column count doesn't match value count at row 1 the problem is that the number of listed values is not the same as the number of listed columns.

THE SQL error codes are rather tersely written and can seem obscure, but once you break them down the meaning is usually quite straightforward.

Tags:

Mysql

Php

Pdo