Home  >  Article  >  php教程  >  mysql php 简单数据查询代码

mysql php 简单数据查询代码

WBOY
WBOYOriginal
2016-06-08 17:27:561790browse
<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()

Statement:
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