hi every one,
i need your help in my php code.Currently i m developing one social site.
i had develop php code code for getting recent update from friends.
my error is for not printing recent update from friends.
i had tried my best but it's not working.
i m attaching code with this article.
please help me.
<?php //code for get values from session
session_start();
if(isset($_SESSION['I'])){
//this code will get email id from session
$myeid = $_SESSION['I'];}
else{
header("Location: loginimgs.php");}
if(isset($_SESSION['NEED'])){
//this code will get password from session
$mypass = $_SESSION['NEED'];}
else{
header("Location: loginimgs.php");}
?>
<?php //code for get value of usercode from database
error_reporting(0);
$myuname = "";
mysql_connect("localhost", "root", "") or die(mysql_error());
mysql_select_db("dummy1") or die(mysql_error());
$check = mysql_query("SELECT * FROM members WHERE email = '$myeid'")or die(mysql_error());
while($info = mysql_fetch_array($check))
{
if ($myeid == $info['email'])
{
$myuname = $info['username'];
$mycode = $info['usercode'];
}
}
?>
<?php //code to fetch friends name from isfriend table and store them in array.
error_reporting(0);
$cout = 0;
$aros;
mysql_connect("localhost", "root", "") or die(mysql_error());
mysql_select_db("dummy1") or die(mysql_error());
$check = mysql_query("SELECT * FROM isfriend WHERE rececode = '$mycode'")or die(mysql_error());
while($info = mysql_fetch_array($check))
{
if ($info['actives'] == 1 and $info['friends'] == 1)
{
$aros[$cout] = $info['usercode'];
$cout = 1 + $cout;
}
}
sort($aros);
?>
<?php //using inter join code will print username from member table and directory name from imgallry table
error_reporting(0);
$cout = 0;
$aros;
mysql_connect("localhost", "root", "") or die(mysql_error());
mysql_select_db("dummy1") or die(mysql_error());
$ibo = "SELECT imgallry.dirname FROM imgallry INNER JOIN members ON imgallry.usercode = members.usercode ORDER BY imgallry.date DESC";
$check = mysql_query($ibo)or die(mysql_error());
while($info = mysql_fetch_array($check))
{
if ($info['members.usercode'] == $aros[$cout])
{
echo $info['members.username'];
$cout = 1 + $cout;
}
}
?>