Home > Backend Development > PHP Tutorial > php从数据库中取值有关问题,请大家指教

php从数据库中取值有关问题,请大家指教

WBOY
Release: 2016-06-13 12:12:03
Original
862 people have browsed it

php从数据库中取值问题,请大家指教
自己做的雇员管理系统 数据库名:empsys  其中包含两张表分别是:emp和admin
现有如下代码:




请各位指教哪里有错!为什么取不到值?
------解决思路----------------------
mysql_fetch_row 改为 mysql_fetch_assoc 或 mysql_fetch_array
------解决思路----------------------
如果要用数据库ID模式应用mysql_fetch_assoc,while循环处改一下。
------解决思路----------------------
如果你要用mysql_fetch_row
那麼下面的
$row['id'], $row['name'], $row['grade']
要改為
$row[0], $row[1], $row[2] 以此類推。

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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template