Number of bound variables does not match number of tokens

Hi folks,

banging head with an error again for hours now .

first my table layout is :smile:

number of bound variables does not match number of tokens’

$query = $db->prepare("INSERT 
                       INTO customers(name,city,address,phone,jointed_date)
                       VALUES(:name,:city,:address,:phone,joined_date)");

$query->execute(array(':name' => $name, 
                      ':city' => $city, 
                      ':address' => $address,
                      ':phone' => $phone,
                      ':joined_date' => $date));
$affected_rows = $query->rowCount();

pls help.

In this bit:

$query = $db->prepare("INSERT 
                       INTO customers(name,city,address,phone,jointed_date)
                       VALUES(:name,:city,:address,:phone,joined_date)");

you don’t have a colon before joined_date at the end of the query. And is the column name correct, with that extra ‘t’ in it?

1 Like

Record added successfully

Thank you so much droopsnoot !

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.