Data Type Mismatch with Access Database

时间:2018-02-01 18:11:03

标签: php sql odbc type-mismatch

Warning: odbc_exec(): SQL error: [Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression., SQL state 22005 in SQLExecDirect in F:\ClientWeb\forms\merchantapp.php on line 845 [Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression.

I've been using this form for a while and as far as I know nothing has changed. But now getting this error when submitting.

Here are the variables I'm using.

$query = 
"INSERT INTO `MerchantApp`
(
    legal,           trade,          addr,            pobox,          
    city,            state,          zip,             pozip,
    ph,              fax,            fedid,           cotype,         
    corpid,          stateofinc,     county,          years,
    bustype,         email,          web,             franchise, 
    name1,           perc1,          addr1,           ssn1,
    dob1,            name2,          perc2,           addr2,        
    ssn2,            dob2,           name3,           perc3,
    addr3,           ssn3,           dob3,            bank1name,    
    bank1ofcr,       bank1ph,        bank1addr,       bank1acct,
    bank1fax,        bank2name,      bank2ofcr,       bank2ph,      
    bank2addr,       bank2acct,      bank2fax,        trade1,
    trade1addr,      trade1acct,     trade1ph,        trade1fax,      
    trade2,          trade2addr,     trade2acct,      trade2ph,
    trade2fax,       trade3,         trade3addr,      trade3acct,   
    trade3ph,        trade3fax,      fpsource,        fpph,
    fpaddr,          fpfax,          contact,         fincontact,     
    corrcontact,     notify,         dd,              formdt,
    citizen,         citizenexpl,    copies,          salesperson
)   
VALUES 
(
    '$legal',       '$trade',       '$addr',         '$pobox',       
    '$city',        '$state',       '$zip',          '$pozip',
    '$ph',          '$fax',         '$fedid',        '$cotype',      
    '$corpid',      '$stateofinc',  '$county',       '$years',
    '$bustype',     '$email',       '$web',          '$franchise',   
    '$name1',       '$perc1',       '$addr1',        '$ssn1',
    '$dob1',        '$name2',       '$perc2',        '$addr2',     
    '$ssn2',        '$dob2',        '$name3',        '$perc3',
    '$addr3',       '$ssn3',        '$dob3',         '$bank1name', 
    '$bank1ofcr',   '$bank1ph',     '$bank1addr',    '$bank1acct',
    '$bank1fax',    '$bank2name',   '$bank2ofcr',    '$bank2ph',  
    '$bank2addr',   '$bank2acct',   '$bank2fax',     '$trade1',
    '$trade1addr',  '$trade1acct',  '$trade1ph',     '$trade1fax',  
    '$trade2',      '$trade2addr',  '$trade2acct',   '$trade2ph',
    '$trade2fax',   '$trade3',      '$trade3addr',   '$trade3acct', 
    '$trade3ph',    '$trade3fax',   '$fpsource',     '$fpph',
    '$fpaddr',      '$fpfax',       '$contact',      '$fincontact', 
    '$corrcontact', '$notify',      '$dd',           '$formdt',
    '$citizen',     '$citizenexpl', '$copies',       '$salesperson'
)" ;

It may that I'm missing something. I've looked at this code too long.

0 个答案:

没有答案