ok i have the following 2 php files:
class 1:
if (isset($related_place_1_id))
{
$row111 = related_item($related_place_1_id);
$place_id111 = $row111['place_id'];
$place = $row111['place_name'];
$ticket_name = $row112['ticket_name'];
$row112 = related_item($related_place_1_id);
$raillink_id11111 = $row112['raillink_id'];
echo $raillink_id11111;
echo $raillink_destination_id;
echo $ticket_name;
class 2:
function related_item($related_place_1_id)
{
$query111 = "SELECT * FROM places WHERE place_id = 7173";
$result111 = mysql_query($query111)
or die ("The system doesn't like your login details- please try again
with different ones.");
$row111 = mysql_fetch_assoc($result111);
//return $row111;
$place_id2 = $row111['place_id'];
//////////////////
// send right id- which id? to this query etc
//////////////////
$query112 = "SELECT raillink_destination_id, place_id, raillink_id, ticket_name FROM raillink_destinations
WHERE place_id = $place_id2";
$result112 = mysql_query($query112)
or die ("The system doesn't like your login details- please try again
with different ones.");
$row112 = mysql_fetch_assoc($result112);
// return $row112
return $row112;
//$raillink_id = $row112['place_id'];
So im calling class 2 in class 1 and trying to return multiple results. However this only works to some extent- it will work for the first query, however not if i used both queries.
The trouble is im trying to get then pass in $place_id2 into the 2nd query, however Ive found that I can only return the whole row or get the fields- I cant do both. Anyone know how to get around this?