# Need help with if and else

**URL:** <https://forum.kirupa.com/t/need-help-with-if-and-else/211269>\
**Category:** Uncategorized\
**Created:** [December 29, 2006, 11:57am UTC](https://forum.kirupa.com/t/need-help-with-if-and-else/211269 "2006-12-29T11:57:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![alapimba](https://avatars.discourse-cdn.com/v4/letter/a/ea666f/32.png) [@alapimba](https://forum.kirupa.com/u/alapimba)\
**Post date:** [December 29, 2006, 11:57am UTC](https://forum.kirupa.com/t/need-help-with-if-and-else/211269/1 "2006-12-29T11:57:01Z")

</div>

Hello,  
I need to echo diferent links depending of an item on a database, but i don’t know how to write the code.  
I guess i’m almost there and must be just a need of ( ) ’ " ; in the right places…  
Can anyone help me?  
I wrote this:

```php
<?php 
        $tipo = $row_rs_clientes_detail['tipo'];
        if ($tipo='pilotos') echo "<a href='perfil_clientes.php?id=$row_rs_clientes_detail['id'];&tipo=$row_rs_clientes_detail['tipo'];'> perfil</a>";
        if ($tipo='equipas') echo "<a href='apresentacao_clientes.php?id=$row_rs_clientes_detail['id'];&tipo=$row_rs_clientes_detail['tipo'];'> apresentação</a>";
        if ($tipo='organizadores') echo "<a href='apresentacao_clientes.php?id=$row_rs_clientes_detail['id'];&tipo=$row_rs_clientes_detail['tipo'];'> apresentação</a>";
        ?>

```
