Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我查询 SQL 表(我正在使用 php)的常规方法是实现以下行:
mysql_query("SELECT * FROM `TABLE_NAME` WHERE SOME CONDITION") or die(mysql_error());
我想以一种返回键/值对的方式进行查询,其中键是列名。任何人都可以提出一种优雅的方式来实现这一点。
用于mysql_fetch_assoc()从表中读取行。
mysql_fetch_assoc()