Just a quick out of thoughts rewrite of your VB thingy there into PHP,
Absolutely no guarentie it will work of any sort
PHP Code:
<?
$con = mysql_connect("localhost","peter","abc123");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("WB", $con);
class details {
var $name;
var $species;
var $sex;
function details($id){
$result = mysql_query("select * from Birds where id = '$id'");
if($array = mysql_fetch_array($result)){
$this->name = $array['name'];
$this->species = $array['species'];
$this->sex = $array['sex'];
}
}
function show(){
echo "<table border=1 cellspacing=0 cellpadding=0>
<tr><td>" . $this->name . "</td>
<tr><td>" . $this->species . "</td>
<tr><td>" . $this->sex. "</td></tr></table>";
}
}
class record{
var $items = array();
var $count;
function record(){
$this->count = 0;
$result = mysql_query("select id from Birds");
while ($array = mysql_fetch_array($result)) {
$this->items[$this->count++] = new details($array['id']);
}
}
function show(){
for($i=0; $i < $this->count; $i++)
$this->items[$i]->show();
}
}
$my_record = new record();
$my_record->show();
?>
For a refference, you can look at the
Object Oriented PHP article.
And DjMs question regarding your age, is of some relevence, since some of your questions seems to come from one who dosn't grasp what is going on, and feel it is easier to ask for a solution than to piece together one from previus explanations.