0
votes
$q = 'INSERT INTO MyTable(proddesc, qnty, PriceH, PriceA, PriceL) VALUES(?,?,?,?,?)';
$sth = odbc_prepare($dbConn, $q);
$success = odbc_execute($sth, array(my 5 variables that are not null));

It gives me the above error - [ODBC Microsoft Access Driver] COUNT field incorrect. I know that the query is correct because I ran it in Access and it was fine. I think I may be using the prepare/execute statements incorrectly.

1
Not really. The syntax looks correct to me. - caine1337

1 Answers

0
votes

I also encountered this now and the solution I did to fix it is to quote the variables properly.

Try printing your $q and you will see if it needs to be quoted.

You can try these too:

  • INSERT INTO TABLE -- quote db and table names using (`) "grave accent" character
  • VALUES( 'Fed''s' ) -- quote the apostrophes