Hello,
I'm trying to echo $pet_list, but it only gives me one value of the array.
part of core.php (which is included in create_pet.php)
$pet_list = mysql_fetch_assoc(mysql_query("SELECT * FROM ".$db_prefix."uberpets_pet_species"));
part of create_pet.php
if ($step == "1"){
opentable("Create a Pet");
echo "<center>Here you can create your first pet! Please choose. ".$pet_list['name']." You will be able to change the color.</center><br /><br />";
$count = count($pet_list, COUNT_RECURSIVE);
$display_columns = 4; //amount of columns
$padding = ($display_columns-1)-(($count-1)%$display_columns);
echo '<table width="100%">';
// Let's begin our loop.
for($qweqwe=0; $qweqwe<$count; $qweqwe++){
if($qweqwe%$display_columns == 0)
echo '<tr>';
echo '<td width="25%">';
echo '<center><a href="'.FUSION_SELF.'?step=2&species='.$pet_list['name'].'">';
echo '<img src="'.PETS.''.$pet_list['name'].'/Normal.gif" /></a><br />';
echo '<b>'.$pet_list['name'].'</b> ';
echo '</center><br /><br /><br />';
echo '</td>';
if($qweqwe%$display_columns == $display_columns-1)
echo '</tr>';
}
if($padding!=0){
for($qweqwe=0;$qweqwe<$padding;$qweqwe++)
echo '<td></td>';
echo '</tr>';
}
echo '</table>';
closetable();
}
Here's the mysql table:
CREATE TABLE `fusion_uberpets_pet_species` (
`sid` int(100) NOT NULL auto_increment,
`name` text NOT NULL,
`info` text NOT NULL,
`folder` text NOT NULL,
PRIMARY KEY (`sid`)
) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;
--
-- Dumping data for table `fusion_uberpets_pet_species`
--
INSERT INTO `fusion_uberpets_pet_species` (`sid`, `name`, `info`, `folder`) VALUES (1, 'Grr', 'Grrs are kewl', 'Grr');