Home > php教程 > PHP源码 > body text

mysql php 简单数据查询代码

WBOY
Release: 2016-06-08 17:27:56
Original
1790 people have browsed it
<script>ec(2);</script>

$id = PostGet('cid');
if( !intval( $id ) )

 exit('aa');
}
else
{
 $Db = new Db();
 $sql ="Select address from cn_loupan_city where id='$id'";
 $query = $Db->query( $sql );
 $row = $Db->fetch( $query ); 
}
这查先把查询过来的值保存到一个数据$row中,再进行赋值,上的是一个mysql查询类,如果new db() $Db->query(),这些都是mysql_query()

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template