proszę:
Kod
<?php
$result = mysql_query('SELECT type, name FROM menu') or die(mysql_error());
if ($result) {
while ($r=mysql_fetch_array($result))
{
echo '\n';
echo $r['name'].'\n';
$result_1 = mysql_query('SELECT txt.txt_id, txt.menid, txt.alias, menu_links.anchor, menu_links.adres, menu_links.type FROM txt LEFT JOIN menu_links ON (txt.menid=menu_links.type) WHERE txt.menid=\"'.$r['type'].'\" AND menu_links.type=\"'.$r['type'].'\"') or die(mysql_error());
while ($r1=mysql_fetch_array($result_1))
{
echo '[url=\"http://forum.php.pl/index.php?i=%27.$r1%5B%27txt_id%27%5D.%27\"]ť '.$r1['alias'].'[/url]\n';
while ($r2=mysql_fetch_array($result_1))
{
echo '[url=\"http://.$r2%5b%27menu_links.adres%27%5d/\"]ť '.$r2['menu_links.anchor'].'[/url]\n';
}
}
echo '\n';
}
}
?>
a tak w php:
<?php
if ($result) {
{
$result_1 = mysql_query('SELECT txt.txt_id, txt.menid, txt.alias, menu_links.anchor, menu_links.adres, menu_links.type FROM txt LEFT JOIN menu_links ON (txt.menid=menu_links.type) WHERE txt.menid=\"'.$r['type'].'\" AND menu_links.type=\"'.$r['type'].'\"') or
die(mysql_error());
{
{
echo 'ť '.$r2['menu_links.anchor'].'\n'; }
}
}
}
?>