I have this php function below for mysql when teh code is ran without using a function I get the result i'm looking for however as a function I must be doing it wrong
function getSingleRow($sql) {
$response = '';
$result = mysql_query_2($sql) or die("<center>An Internal Error has Occured. Please report following error to the webmaster.<br><br>" . $sql . "<br><br>" . mysql_error() . "'</center>");
$line = mysql_fetch_row($result);
return $line[0];
}
$sql='SELECT disp_name,photo_view FROM friend_reg_user WHERE auto_id=' .$userid;
$result= getSingleRow($sql);
the code above would return th4 value for disp_name how can I get the value for photo name as well? I know how to do it like this
$line[0]
$line[1]
but how can I get it where I can call a function and get mutiple results like $line[0]
$line[1] returned?