求PHP获取数据表字段值的完整代码
数据表php_area
字段areaid,name
获取areaid=2,name的值
麻烦知道的大哥给完整的代码,谢谢了
------解决方案--------------------
<a style="color:#f60; text-decoration:underline;" title="mysql" href="https://www.php.cn/zt/15713.html" target="_blank">mysql</a>_connect("localhost",'用户名','密码');
mysql_select_db('库名');
$r=mysql_query("select name from php_area where areaid=2");
$row=mysql_fetch_row($r); //如果areaid 不唯一,此处加上while循环
echo $row[0]; <div class="clear"></div>
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号