Jump to content

query not returning data


barefootsanders

Recommended Posts

Hey all.  I'm having problems with my site.  I'm trying to return information on a certain "family" or clan and the string my query returns is empty.  Below is the familyinfo.php page which calls the function and below that is the function from database.php.  If anyone has any suggestions it would be much appreciated. Thanks!

 

<?php
//familyinfo.php

//Inform user of successfull faimly creation only on first time
if($_SESSION['newfamily'] == true)
{
$_SESSION['newfamily'] = false;
echo "Congratulations! You created a new family. Click here to continue to your families info page.<br>";
echo "<a href\"index.php?page=familyinfo\">Family Home Page</a>";
}
else
{
//Get family ID your are viewing and family info array
$req_famID = 14;
$req_family = $database->getFamilyInfo($req_famID);	

//User is in family
if(strcmp($session->family_id,$req_famID))
{
	echo "<h2 id=\"topper\">Your Family</h2><br>";
	echo $req_family_info['family_name'];
}
//User is not in family
else
{
	echo "<h2 id=\"topper\">"; echo $req_family_info['family_name']; echo "</h2><br>";

}

echo $req_family_info['family_desc'];

}
?>

 

//database.php
function getFamilyInfo($id)
{
	$q = "SELECT * FROM ".TBL_FAMILIES." WHERE faimly_id = '$id'";
	$result = mysql_query($q, $this->connection);
	//Error occurred, return given name by default
	if(!$result || (mysql_numrows($result) < 1))
	{
		return NULL;
	}
	/* Return result array */
	$dbarray = mysql_fetch_array($result);
	return $dbarray;
}

 

Link to comment
https://forums.phpfreaks.com/topic/45808-query-not-returning-data/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.