I have this function called on another page.
function adminnav (){
$pagewcoms = mysql_query("SELECT DISTINCT pageid FROM comments") or die(mysql_error());
$idnavrow = mysql_fetch_row($pagewcoms);
while ($itest = mysql_fetch_row($pagewcoms)) {
echo "$itest[0] <br />";
}
}
adminnav('');
The table looks like this
CREATE TABLE `comments` (
`commentid` int(5) NOT NULL auto_increment,
`pageid` int(5) NOT NULL default '0',
`name` text NOT NULL,
`email` text NOT NULL,
`comment` text NOT NULL,
`date` datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (`commentid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=481 ;
INSERT INTO `comments` VALUES(480, 1, '3', '3', '3', '2011-09-13 22:43:06');
INSERT INTO `comments` VALUES(479, 1, '2', '2', '2', '2011-09-13 22:43:01');
INSERT INTO `comments` VALUES(476, 1, '1', '1', '1', '2011-09-13 17:22:49');
INSERT INTO `comments` VALUES(477, 2, 'taylordcraig', '[email protected]', 'this is page two', '2011-09-13 17:26:09');
INSERT INTO `comments` VALUES(478, 3, 'this is page3', 'this is page3', 'this is page3', '2011-09-13 22:28:59');
My problem is the function prints "array array" I can deal with the data, but shouldn't there be 3 distinct results? This is the closest I've been. The idea is to search the table and find pages with comments, which I will later list as links.
So the result I'm looking for would be
"1 2 3"
thank you in advance.
EDIT:
I'm sorry I worded my question poorly. The porlem isnt "array array" it's that there's only two. I can make it display but it doesnt matter. I still only have "2 3" displaying, as said before, I only had two array data.
[** me, am I going to have to re-ask this now?]