我有以下数据库架构,
CREATE TABLE `tz_todo` (
`id` int(8) unsigned NOT NULL auto_increment,
`position` int(8) unsigned NOT NULL default '0',
`text` varchar(255) collate utf8_unicode_ci NOT NULL default '',
`dt_added` timestamp NOT NULL default CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `position` (`position`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
如果我正在编写以下 PHP 语句,
$query = mysql_query("SELECT * FROM `tz_todo` ORDER BY `position` ASC");
如何访问 $query 中的文本项?
请指导。谢谢
更新:我试过这个,
echo $query['id'];
echo $query['position'];
echo $query['text'];