PHP头条
热点:

透过html传递过来的参数,php查询access


通过html传递过来的参数,php查询 access
html页面传递数据给php页面,作为条件参数查询,
数据库表 szd_t ;字段   username, password
我需要查询结果显示在html页面上,如何实现? 
$rs->Open("select * from szd_t where username="$_POST["name"],$conn,1,1); 这一句是否有问题? 其他代码至少语法没有错误,
完整代码如下:
//文件access.html


html




Name: 


 

//文件accessdb2.php
$conn = new com("ADODB.Connection");
$connstr = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=". realpath("db.mdb");
$conn->Open($connstr);
$rs = new com("ADODB.RecordSet");
$rs->Open("select * from szd_t where username="$_POST["name"],$conn,1,1);
while(! $rs->eof)
{
$f = $rs->Fields(1);
$f2 = $rs->Fields(0);
echo $f2->value;
echo $f->value;
$rs->MoveNext();
}
//echo "《script》alert('success!');《script》";
?> 分享到:
------解决方案--------------------
楼主想知道个啥东西呀,自己测试一下有没有报错不就知道了吗。

www.phpzy.comtrue/phprm/6567.htmlTechArticle透过html传递过来的参数,php查询access 通过html传递过来的参数,php查询 access html页面传递数据给php页面,作为条件参数查询, 数据库表szd_t;字段username,password 我需要查询结果显示在...

相关文章

相关频道:

PHP之友评论

今天推荐