0
$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.

bennofs
  • 11,873
  • 1
  • 38
  • 62
caine1337
  • 63
  • 1
  • 7

1 Answers1

0

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
fedmich
  • 5,343
  • 3
  • 37
  • 52