Home > php教程 > php手册 > body text

php+mysql调用数据库示例

WBOY
Release: 2016-06-21 09:05:35
Original
1424 people have browsed it

mysql|示例|数据|数据库

$conn= mysql_connect('localhost','root','123456') or die('connect error:'.mysql_error());
mysql_select_db('netDuzhe');
$result=Mysql_query('select * from article');
    while ($row = mysql_Fetch_array($result, MYSQL_BOTH)) {
        printf ("ID: %s  Name: %s content:%s", $row[0], $row[1],$row[2]);
    }

    mysql_free_Result($Result);
?>

注意点



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