$today = date("Y-m-d");
$result1 = mysql_query("
SELECT * FROM tbl_outing INNER JOIN bp_frieds
ON `tbl_outing`.`userid` = `bp_frieds`.`uid`
WHERE startdate >= '$today'
AND friendstype='Public'
AND uid
IN (SELECT fuid FROM bp_frieds WHERE uid='$getuserData')
GROUP BY userid
ORDER BY startdate, starttime DESC");
while ($row = mysql_fetch_array($result1)) {
echo "test";
}
ORDER BY startdate, starttime DESC") or die(mysql_error());
$query1 = "
SELECT * FROM tbl_outing INNER JOIN bp_frieds
ON `tbl_outing`.`userid` = `bp_frieds`.`uid`
WHERE startdate >= '$today'
AND friendstype='Public'
AND uid
IN (SELECT fuid FROM bp_frieds WHERE uid='$getuserData')
GROUP BY userid
ORDER BY startdate, starttime DESC";
echo"$query1";
$result1 = mysql_query($query1) or die(mysql_error);
$today = date("Y-m-d");
$query1 = "
SELECT * FROM tbl_outing INNER JOIN bp_frieds
ON `tbl_outing`.`userid` = `bp_frieds`.`uid`
WHERE startdate >= '$today'
AND friendstype='Public'
AND uid
IN (SELECT fuid FROM bp_frieds WHERE uid='$getUserData')
GROUP BY userid
ORDER BY startdate, starttime DESC";
$result1 = mysql_query($query1) or die(mysql_error);
while ($row = mysql_fetch_array($result1)) {
if($row['friendstype'] == "Public") {
?>
<div class="friends_area" id="record-<?php echo $row['outing_id']?>">
<div class="fleft">
<div class="profilePic">
<?php imageurl($row['p_Image'],'102px',''); ?>
</div>
</div>
<div class="fleft" style="margin-left: 7px;">
<label style="float:left">
<h5 style="margin-bottom: 0px; font-size: 12px;"><?php echo $row['outing_name']." - ".$row['location'];?></h5>
<span><?php display_date($log_date); ?></span>
<a href="javascript: void(0)" id="post_id<?php echo $row['outing_id']?>" class="showCommentBox links" style="text-decoration:underline;">Comments</a><br />
<p><?php echo "Date: ".$row['startdate']." Time: ".$row['starttime']." - ".$row['endtime'] ?></p><br clear="all" />
</label>
</div>
<br clear="all" />
<div id="CommentPosted<?php echo $row['outing_id']?>">
<?php
$comment_num_row = mysql_num_rows(@$comments);
if($comment_num_row > 0) {
while ($rows = mysql_fetch_array($comments)) {
//display_date($rows['CommentTimeSpent']);
?>
<div class="commentPanel" id="record-<?php echo $rows['c_id'];?>" align="left">
<div class="fleft">
<div class="profilePicSmall">
<?php Commentimageurl($rows['comment_image'],'60px',''); ?>
</div>
</div>
<div class="fleft">
<label class="postedComments">
<?php echo $rows['comments'];?>
</label><br clear="all" />
<span style="margin-left:7px; color:#666666;"><?php display_date($rows['date_created']); ?></span>
<?php if($rows['userid'] == $getUserData) { ?>
<a href="#" id="CID-<?php echo $rows['c_id'];?>" class="comment_delete">Delete</a>
<?php } ?>
</div>
<br clear="all" />
</div>
<?php
}
}
?>
</div>
<div class="commentBox" align="right" id="commentBox-<?php echo $row['outing_id'];?>" <?php echo (($comment_num_row) ? '' :'style="display:none"')?>>
<?php
//Commentimageurl($row['p_Image'],40,40);
$Comment_data1=mysql_query("SELECT bname,b_Image FROM bp_details_tab where userid=".$getUserData."
UNION ALL
SELECT CONCAT(firstname,' ',lastname) bname ,p_Image b_Image FROM public_details_tab where userid=".$getUserData);
while ($photo_comment_data = mysql_fetch_array($Comment_data1)) {
echo '<div class="profilePicSmall" style="float: left;">';
Commentimageurl($photo_comment_data['b_Image'],'60px','');
echo '</div>';
//echo $photo_comment_data['bname'];
}
?>
<label id="record-<?php echo $row['outing_id'];?>">
<textarea name="commentMark" cols="60" rows="2" class="commentMark" id="commentMark-<?php echo $row['outing_id'];?>"></textarea>
</label><br clear="all" />
<a id="SubmitComment" class="small button comment">Comment</a>
</div>
</div><br /><br />
<?php
}
$comments = mysql_query("SELECT outing_comment_table.*,outing_comment_table.date_created AS CommentTimeSpent,public_details_tab.p_Image as comment_image FROM outing_comment_table INNER JOIN public_details_tab ON outing_comment_table.userid=public_details_tab.userid where outing_comment_table.post_id = ".$row['outing_id']."
UNION ALL
SELECT outing_comment_table.*,outing_comment_table.date_created AS CommentTimeSpent,bp_details_tab.b_Image as comment_image FROM outing_comment_table INNER JOIN bp_details_tab ON outing_comment_table.userid=bp_details_tab.userid where outing_comment_table.post_id = ".$row['outing_id'].""); //get comment table data
$today = date("Y-m-d");
$query1 = "
SELECT * FROM tbl_outing INNER JOIN bp_frieds
ON `tbl_outing`.`userid` = `bp_frieds`.`uid`
WHERE startdate >= '$today'
AND friendstype='Public'
AND uid
IN (SELECT fuid FROM bp_frieds WHERE uid='$getUserData')
GROUP BY userid
ORDER BY startdate, starttime DESC";
$result1 = mysql_query($query1) or die(mysql_error);
while ($row = mysql_fetch_array($result1)) {
$comments = mysql_query("SELECT outing_comment_table.*,outing_comment_table.date_created AS CommentTimeSpent,public_details_tab.p_Image as comment_image FROM outing_comment_table INNER JOIN public_details_tab ON outing_comment_table.userid=public_details_tab.userid where outing_comment_table.post_id = ".$row['outing_id']."
UNION ALL
SELECT outing_comment_table.*,outing_comment_table.date_created AS CommentTimeSpent,bp_details_tab.b_Image as comment_image FROM outing_comment_table INNER JOIN bp_details_tab ON outing_comment_table.userid=bp_details_tab.userid where outing_comment_table.post_id = ".$row['outing_id'].""); //get comment table data
if($row1['friendstype'] == "Public") {
?>
<div class="friends_area" id="record-<?php echo $row['outing_id']?>">
<div class="fleft">
<div class="profilePic">
<?php imageurl($row['p_Image'],'102px',''); ?>
</div>
</div>
<div class="fleft" style="margin-left: 7px;">
<label style="float:left">
<h5 style="margin-bottom: 0px; font-size: 12px;"><?php echo $row['outing_name']." - ".$row['location'];?></h5>
<span><?php display_date($log_date); ?></span>
<a href="javascript: void(0)" id="post_id<?php echo $row['outing_id']?>" class="showCommentBox links" style="text-decoration:underline;">Comments</a><br />
<p><?php echo "Date: ".$row['startdate']." Time: ".$row['starttime']." - ".$row['endtime'] ?></p><br clear="all" />
</label>
</div>
<br clear="all" />
<div id="CommentPosted<?php echo $row['outing_id']?>">
<?php
$comment_num_row = mysql_num_rows(@$comments);
if($comment_num_row > 0) {
while ($rows = mysql_fetch_array($comments)) {
//display_date($rows['CommentTimeSpent']);
?>
<div class="commentPanel" id="record-<?php echo $rows['c_id'];?>" align="left">
<div class="fleft">
<div class="profilePicSmall">
<?php Commentimageurl($rows['comment_image'],'60px',''); ?>
</div>
</div>
<div class="fleft">
<label class="postedComments">
<?php echo $rows['comments'];?>
</label><br clear="all" />
<span style="margin-left:7px; color:#666666;"><?php display_date($rows['date_created']); ?></span>
<?php if($rows['userid'] == $getUserData) { ?>
<a href="#" id="CID-<?php echo $rows['c_id'];?>" class="comment_delete">Delete</a>
<?php } ?>
</div>
<br clear="all" />
</div>
<?php
}
}
?>
</div>
<div class="commentBox" align="right" id="commentBox-<?php echo $row['outing_id'];?>" <?php echo (($comment_num_row) ? '' :'style="display:none"')?>>
<?php
//Commentimageurl($row['p_Image'],40,40);
$Comment_data1=mysql_query("SELECT bname,b_Image FROM bp_details_tab where userid=".$getUserData."
UNION ALL
SELECT CONCAT(firstname,' ',lastname) bname ,p_Image b_Image FROM public_details_tab where userid=".$getUserData);
while ($photo_comment_data = mysql_fetch_array($Comment_data1)) {
echo '<div class="profilePicSmall" style="float: left;">';
Commentimageurl($photo_comment_data['b_Image'],'60px','');
echo '</div>';
//echo $photo_comment_data['bname'];
}
?>
<label id="record-<?php echo $row['outing_id'];?>">
<textarea name="commentMark" cols="60" rows="2" class="commentMark" id="commentMark-<?php echo $row['outing_id'];?>"></textarea>
</label><br clear="all" />
<a id="SubmitComment" class="small button comment">Comment</a>
</div>
</div><br /><br />
<?php
}
}//end bind outing details
Open in new window
I suspect there's something wrong with the ' signs around field names