resource(3) of type (odbc result) while i am inserting data to ms access using php script

你离开我真会死。 提交于 2019-12-12 01:06:35

问题


my code is-

<?php
$test='C:\xampp\htdocs\cit\con1.mdb';
$connection = odbc_connect("Driver={Microsoft Access Driver (*.mdb)};Dbq=$test", "", "");
$txtroll=$_REQUEST['txtroll'];
$all="face";
$sql="INSERT INTO inst (info,sname) VALUES ('$all','$txtroll')";
$rs =   odbc_exec($connection, $sql);
var_dump($rs);
?>

The data I am sending through query is not getting stored in the database.


回答1:


There is no problem here. You are seeing

resource(3) of type (odbc result)

because that's the type of object that $rs actually is (and var_dump is telling you that). According to the PHP documentation, odbc_exec...

Returns an ODBC result identifier if the SQL command was executed successfully, or FALSE on error.

(ref: here). $rs is not FALSE, so the INSERT encountered no errors. (At least none that PHP knows about, anyway....)



来源:https://stackoverflow.com/questions/21578059/resource3-of-type-odbc-result-while-i-am-inserting-data-to-ms-access-using-p

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!