使用通过ODBC访问的条件表达式中的数据类型不匹配 [英] Data type mismatch in criteria expression using Access via ODBC
问题描述
$conn=odbc_connect('mobshopDB','','');
if(!$conn){
exit("Connection Failed: " . $conn);
}
$query="INSERT INTO users(uid,pass,fname,lname,pmm) VALUES('$username','$password','$fname','$lname',$pmm)";
$rs=odbc_exec($conn,$query);
此查询给我这个错误
Warning: odbc_exec() [function.odbc-exec]: SQL error: [Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression., SQL state 22005 in SQLExecDirect in C:\Program Files\EasyPHP-5.3.6.0\www\mobshop\registered.php on line 39
..请提出解决方案
注意:pmm是一个数字字段,这就是为什么我没有将其用引号引起来.
NOTE: pmm is a numeric field, thats why i haven't put it in quotes.
推荐答案
数据类型不匹配"表示您试图在第一组变量中列出的一个字段的变量中传递错误的数据类型.括号.
"Data Type Mismatch" indicates that you are trying to pass in an incorrect data type in one of your variables for one of the fields listed in your first set of parenthesis.
尝试使用echo将$ query写入屏幕,然后获取结果并在您的MS Access数据库查询设计器中运行它(假定您具有MS Access软件).
Try writing $query to the screen using echo and then take that result and run it in your MS Access database query designer (assuming you have the MS Access software).
这篇关于使用通过ODBC访问的条件表达式中的数据类型不匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!