Hi all

While I am using the below query I am getting the error msg like "Column count doesn't match value count at row 1"

INSERT INTO datain2.student(id,name) VALUES ($query_row[id],'$query_row[name]');

and

I am sure about there is no where conflict with the columns of tables

    You get that error if the number of columns specified (column count) isn't equal to the number of values specified (value count). You seem to have 2 columns and 2 values in this query, but since you show us code, and most likely not complete code, rather than the actually genereated sql query, it is impossible to say.
    Do something like this

    $query = "INSERT INTO....";
    if (!$db->query)
        error_log($query);  // or echo
    

    If the query fails to execute, you will see exactly the same query as was sent to the db, either on screen or in your error log.

      Write a Reply...