0

good got job nearly finished but one slight glitch i have 2 entries in database but only one is showing twice in table results how can i get to show both results heres code

fetch and connection block

<?php 
include("config/db_connect.php");
//include("config/ckh_session.php"); 

$sql = "SELECT * FROM meets";
$result = mysqli_query($conn, $sql);

//fetch user

$meets          = mysqli_query($conn,"select * from meets");
$fetch_meets     = mysqli_fetch_array($meets);

$query          = mysqli_query($conn,"select * from user");
$fetch_user     = mysqli_fetch_array($query);
$user_birthdate = $fetch_user['user_birthdate'];
$partneruser_birthdate = $fetch_user['partneruser_birthdate'];

//fetch user image

$user_image = mysqli_query($conn,"select * from user_images where user_id = '".$fetch_user['user_id']."' and main_image = '1' ");
$fetch_image    = mysqli_fetch_array($user_image);

// for user online status
        $showuser   = mysqli_fetch_array(mysqli_query($conn," select  online_status from user_lastlogin  where user_id = '".$user_id."' "));
        $onstatus   = $showuser['online_status'];

?>

results block

<?php
if (mysqli_num_rows($result) > 0) {
?> <table border='1' cellpadding='10' width='650'> <tr> <?php
while ($row = mysqli_fetch_object($result)) { 
?> <td colspan="2"><?php echo ucfirst($fetch_user['user_name']);?>      <?php echo Age($user_birthdate);?> & <?php echo Age($partneruser_birthdate);?><i style="float: right; ">Seeking a ...<?php echo $fetch_meets['event_ltm'];?></i></td> </tr> <tr> <td style="width: 64px; height: 64px; text-align: center"><?php 
        $sql_slide = mysqli_query($conn,"select * from user_images where user_id = '".$fetch_user['user_id']."' and show_profile = '1' ");
        if(mysqli_num_rows($sql_slide)>1) {
        while($row_slide = mysqli_fetch_array($sql_slide))
        {
    ?> <img src="images/user_images/smallthumb/<?php echo $row_slide['user_image'];?>" border="0" width="100" height="100" data-tooltip="sticky<?php echo $row_slide['id'];?>" /> <?php 
        } }
        ?> <?php 
            $sql_slideh = mysqli_query($conn,"select * from user_images where user_id = '".$fetch_user['user_id']."' and show_profile = '1' ");
            while($row_slideh = mysqli_fetch_array($sql_slideh))
            {
        ?> <?php echo $row_slideh['id'];?>" class="atip"> <img  src="images/user_images/<?php echo $row_slideh['user_image'];?>" /> <?php if($row_slideh['caption']!='') { ?> <?php echo $row_slideh['caption'];?> <?php } ?> <?php } ?> <?php if($fetch_image['user_image']!='') {?> <img  src="images/user_images/<?php echo $fetch_image['user_image'];?>" height="150px;" width="150px;" /> <?php } else { ?> <img  src="images/blank_big.jpg" height="150px;" width="150px;" /> <?php  } ?></td> <td width='550'><table> <tr><td>  <?php echo $fetch_meets['event_type'];?></td></tr> <tr><td>  <?php echo $fetch_meets['event_country'];?></td></tr> <tr><td>  <?php echo $fetch_meets['event_postcode'];?></td></tr> <tr><td>  <?php echo $fetch_meets['event_title'];?></td></tr> <tr><td>  <?php echo $fetch_meets['event_description'];?></td></tr></table></td> </tr> <tr> <td colspan="2"><?php echo $fetch_meets['event_date'];?><i style="float: right; "><font color="#008000"><?php if($onstatus==1) { echo "Online"; } ?> </font></i></td> </tr> <?php } ?> </table> <?php
} else {
    echo "0 results";
}

mysqli_close($conn);
?>

any help would be much appreciated thankyou jan x

1
Contributor
2
Replies
25
Views
5 Months
Discussion Span
Last Post by janicemurby
0

ive attempted to add this section below

<?php
  if ($result = mysqli_query($conn,"SELECT * FROM meets ORDER BY id"))
{

into the code below

<?php
  if ($result = mysqli_query($conn,"SELECT * FROM meets ORDER BY id"))<<< added this >>>>
{
if (mysqli_num_rows($result) > 0) {
?>
    <table border='1' cellpadding='10' width='650'>
    <tr>

<?php
while ($row = mysqli_fetch_object($result)) { 
?>
<td colspan="2"><?php echo ucfirst($fetch_user['user_name']);?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo Age($user_birthdate);?>&nbsp;&&nbsp;<?php echo Age($partneruser_birthdate);?><i style="float: right; ">Seeking a ...<?php echo $fetch_meets['event_ltm'];?></i></td>
</tr>
<tr>
<td style="width: 64px; height: 64px; text-align: center"><?php 
        $sql_slide = mysqli_query($conn,"select * from user_images where user_id = '".$fetch_user['user_id']."' and show_profile = '1' ");
        if(mysqli_num_rows($sql_slide)>1) {
        while($row_slide = mysqli_fetch_array($sql_slide))
        {
    ?>
      <img src="images/user_images/smallthumb/<?php echo $row_slide['user_image'];?>" border="0" width="100" height="100" data-tooltip="sticky<?php echo $row_slide['id'];?>" />
      <?php 
        } }
        ?>

          <?php 
            $sql_slideh = mysqli_query($conn,"select * from user_images where user_id = '".$fetch_user['user_id']."' and show_profile = '1' ");
            while($row_slideh = mysqli_fetch_array($sql_slideh))
            {
        ?>
          <?php echo $row_slideh['id'];?>" class="atip"> <img  src="images/user_images/<?php echo $row_slideh['user_image'];?>" />
            <?php if($row_slideh['caption']!='') { ?>

              <?php echo $row_slideh['caption'];?>

            <?php } ?>

          <?php } ?>

        <?php if($fetch_image['user_image']!='') {?>
        <img  src="images/user_images/<?php echo $fetch_image['user_image'];?>" height="150px;" width="150px;" />
        <?php } else { ?>
        <img  src="images/blank_big.jpg" height="150px;" width="150px;" />
        <?php  } ?></td>
        <td width='550'><table>
        <tr><td>&nbsp;&nbsp;<?php echo $fetch_meets['event_type'];?></td></tr>
        <tr><td>&nbsp;&nbsp;<?php echo $fetch_meets['event_country'];?></td></tr>
        <tr><td>&nbsp;&nbsp;<?php echo $fetch_meets['event_postcode'];?></td></tr>
        <tr><td>&nbsp;&nbsp;<?php echo $fetch_meets['event_title'];?></td></tr>
        <tr><td>&nbsp;&nbsp;<?php echo $fetch_meets['event_description'];?></td></tr></table></td>
</tr>
<tr>
<td colspan="2"><?php echo $fetch_meets['event_date'];?><i style="float: right; "><font color="#008000"><?php if($onstatus==1) { echo "Online"; } ?>  </font></i></td>
</tr>
<?php } ?>
</table>

<?php
} else {
    echo "0 results";
}
}
mysqli_close($conn);
?>

into

Edited by janicemurby: missed bit out

Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.