as far as i can see, all it does is store the data in the variable. since a variable IS a temporary data holder, that would be what it’s talking about. if you’re looking to get the date selected into an array, you can try making a new variable like this and using mysql_fetch_array:
[php]<?php
$query= “SELECT * FROM PET”;
$result = mysql_query($query) or die (“Couldn’t execute query.”);
$array = mysql_fetch_array( $result );
?>[/php]
Then you could do something like the below to print out the output. I’ll create a few fake column names since I don’t know what you have in your table:
[php]
$output = "ID: ".$array[‘id’];
$output .= "Name: ".$array[‘name’];
$output .= "Address: ".$array[‘address’];
print $output;
[/php]
What mysql_fetch_array does is make the variable the data is stored in an associate array with the table’s column names as keys (‘id’, ‘name’, ‘address’, etc.) Similarly, if you read a bit ahead and learn about objects, you could use mysql_fetch_object, in which case your item would be stored as an object:
[php]
<?php
$query= "SELECT * FROM PET";
$result = mysql_query($query) or die ("Couldn't execute query.");
$object = mysql_fetch_object( $result );
$output = "ID: ".$object->id;
$output .= "Name: ".$object->name;
$output .= "Address: ".$object->address;
print $output;
?>
[/php]
If you’re trying to access multiple mysql rows of data with that statement, you can do something like this:
[php]
<?php
$query= "SELECT * FROM PET WHERE id ='".$id"'";
$result = mysql_query($query) or die ("Couldn't execute query.");
while( $object = mysql_fetch_object( $result ) ) {
$output = "ID: ".$object->id;
$output .= "Name: ".$object->name;
$output .= "Address: ".$object->address;
print $output;
};
?>
[/php]
that help?