# Imbricated request

**URL:** <https://forum.kirupa.com/t/imbricated-request/245084>\
**Category:** flash\
**Created:** [November 26, 2007, 9:46am UTC](https://forum.kirupa.com/t/imbricated-request/245084 "2007-11-26T09:46:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nodesign](https://avatars.discourse-cdn.com/v4/letter/n/c68b51/32.png) [@nodesign](https://forum.kirupa.com/u/nodesign)\
**Post date:** [November 26, 2007, 9:46am UTC](https://forum.kirupa.com/t/imbricated-request/245084/1 "2007-11-26T09:46:32Z")

</div>

Hello,

I’m trying to make a website site with several cascading menus (Actionscript 2.0).  
It’s the first time I’m working with XML. I’m trying to extract my database data (MySQL) and format it in a valid XML file.

I have to tables : ‘author’ and ‘works’. I’d like to execute an imbricated request : for each author, i’d like to extract his works. (The fields author.firstname and works.author are the same.)

I wrote this code but it doesn’t work :

```php
<?php 

$id = mysql_connect("localhost:8889","root","root");

mysql_select_db("pixovecto");

$query = "SELECT * FROM auteur" ;
$result = mysql_query($query,$id);

$compteur=0;

while ($liste = mysql_fetch_array($result))
{
$travaux = "SELECT * FROM travaux WHERE travaux.auteur=".$liste[prenom] ;
echo "&nom".$compteur."=".utf8_encode(($liste[nom]));
echo "&prenom".$compteur."=".utf8_encode(($liste[prenom]));
echo "&animation".$compteur."=".utf8_encode(($liste[animation]));
echo "&specialite".$compteur."=".utf8_encode(($liste[specialite]));
echo "&texte".$compteur."=".utf8_encode(($liste[texte]));
echo "&adresse".$compteur."=".utf8_encode(($liste[adresse]));
echo "&tel".$compteur."=".utf8_encode(($liste[tel]));
echo "&mail".$compteur."=".utf8_encode(($liste[mail]));
    $i=0;
    while ($liste2 = mysql_query($travaux,$id))
    {
        echo "&titre".$i."=".utf8_encode(($liste2[titre]));
        echo "&categorie".$i."=".utf8_encode(($liste2[categorie]));
        echo "&vignette".$i."=".utf8_encode(($liste2[vignette]));
        echo "&img".$i."=".utf8_encode(($liste2[img]));
        echo "&commentaire".$i."=".($liste2[commentaire]);
        echo "&date".$i."=".($liste2[date]);
    $i++;
    }
$compteur++;
}

mysql_free_result ($result);

?>

```

Thank you for your help,

Raphaël
