pdo 连库

来源:互联网 发布:我是一名淘宝差评师 编辑:程序博客网 时间:2024/05/16 05:31
           $dsn = "mysql:host=127.0.0.1;dbname=iwebshop";
           $db = new PDO($dsn, 'root', 'root');
           $db->query('set names utf8');
           $count=$db->query("select * from iwebshop_order where order_no =".$orderno)->fetchAll(PDO::FETCH_ASSOC);
           
           $result['code']=1;
           $result['content']=$count;
           $json = json_encode($result);
           echo $_GET['callback']."($json)";
0 0
原创粉丝点击