Title: Unexpected SQL error
Last modified: October 21, 2019

---

# Unexpected SQL error

 *  Resolved [hypopolol](https://wordpress.org/support/users/hypopolol/)
 * (@hypopolol)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/unexpected-sql-error/)
 * Hi,
 * On my activate plugin action action i creat a table:
 * `$sql = 'CREATE TABLE '.$cat_tab.'(id int primary key AUTO_INCREMENT, CATID text,
   PARENT text, NAME text)';`
 * And when i’m trying to add data on it :
 * `$sql = "INSERT INTO ".$table_name." ( CATID, PARENT, NAME ) VALUES ('".$id.",".
   $parent.", ".$cat_name."')";`
 * It says:
 * Erreur de la base de données WordPress : [Column count doesn’t match value count
   at row 1]
    INSERT INTO XX_XXXXXXX_XX ( CATID, PARENT, NAME ) VALUES (’43, 4, 
   MATERIEL INFORMATIQUE ‘)
 * Same thing if i remove the autoincrement ID, i don’t get it ..
 * Anyone know something about this issue ?

Viewing 1 replies (of 1 total)

 *  Thread Starter [hypopolol](https://wordpress.org/support/users/hypopolol/)
 * (@hypopolol)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/unexpected-sql-error/#post-12049239)
 * Ok damn me, i forgot to remove ” in datas …

Viewing 1 replies (of 1 total)

The topic ‘Unexpected SQL error’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [hypopolol](https://wordpress.org/support/users/hypopolol/)
 * Last activity: [6 years, 7 months ago](https://wordpress.org/support/topic/unexpected-sql-error/#post-12049239)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
