Jump to content

Recommended Posts

Hello,

today's problem - my table only shows recipent which are in group, not ones without a group. I think I made wrong query to database.

$q = "SELECT * FROM recipent, group WHERE group.id_group=recipent.group_id"; 
$w = mysql_query($q) or die ('Error: '. mysql_error()); 

?> 
<hr /> 
<table method='get'> 
<tr><th></th><th> 
<a href="<?php echo $_SERVER['PHP_SELF'];?>?sortuj=imie">Imię</a> 
  </th><th> 
<a href="<?php echo $_SERVER['PHP_SELF'];?>?sortuj=nazwisko">Nazwisko</a> 
  </th><th> 
<a href="<?php echo $_SERVER['PHP_SELF'];?>?sortuj=telefon">Telefon</a></th><th><a href="<?php echo $_SERVER['PHP_SELF'];?>?sortuj=mail">Mail</a> </th> 
<th> 
<a href="<?php echo $_SERVER['PHP_SELF'];?>?sortuj=miasto">Miasto</a></th><th><a href="<?php echo $_SERVER['PHP_SELF'];?>?sortuj=ulica">Ulica</a> </th> 
<th> 
<a href="<?php echo $_SERVER['PHP_SELF'];?>?sortuj=kodpocztowy">Kod Pocztowy</a></th> 
<th> 
<a href="<?php echo $_SERVER['PHP_SELF'];?>?sortuj=grupa_id">Grupa</a></th></tr> 

<?php 
while ($record = mysql_fetch_assoc($w)) { 
?> 
    <tr> 
            <td><input type="checkbox"/></td> 
            <td><?php echo $rekord['imie'];?></td> 
            <td><?php echo $rekord['nazwisko'];?></td> 
            <td><?php echo $rekord['telefon']; ?></td> 
            <td><?php echo $rekord['mail'];?></td> 
            <td><?php echo $rekord['miasto'];?></td> 
            <td><?php echo $rekord['ulica']; ?></td> 
            <td><?php echo $rekord['kodpocztowy']; ?></td> 
            <td><?php echo $rekord['nazwa']; ?></td> 
            <td><a href="odbiorcy_edytuj.php?akcja=edytuj&id_klient=<?php echo $rekord['id_klient'];?>"><?php echo "Edytuj"?></a></td> 
            <td><a href="odbiorcy_usun.php?akcja=usun&id_klient=<?php echo $rekord['id_klient'];?>"><?php echo "Usuń"?></a></td> 
</td> 
    </tr> 
<?php 
} 
?> 
</table>

And code bellow is cell where group name is displayed.

<td><?php echo $rekord['nazwa']; ?></td>

 

Link to comment
https://forums.phpfreaks.com/topic/227078-listing-recipents-with-groups/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.