select($idd);
?>
 |
|
if ($idd==0) {
$q=mysql_query("select idd, name, idpd from d where idpd=0 and visible=1 order by code");
$qa=mysql_fetch_row($q);
while ($qa) {
echo"
\n";
$qa=mysql_fetch_row($q);
}
mysql_free_result($q);
} else {
$q=mysql_query("select idd, name, idpd from d where idd=$idd");
$qa=mysql_fetch_row($q);
mysql_free_result($q);
$space=" ";
if ($qa[2]==0) {
echo "
\n";
$q=mysql_query("select idd, name, idpd from d where idpd=$idd and visible=1 order by code");
$qa=mysql_fetch_row($q);
while ($qa) {
echo "
\n";
$qa=mysql_fetch_row($q);
}
mysql_free_result($q);
} else {
$str="
\n";
$q=mysql_query("select idd, name, idpd from d where idd=$qa[2]");
$qa=mysql_fetch_row($q);
mysql_free_result($q);
echo "
\n";
echo "$str";
$q=mysql_query("select idt, name, idd from t where idd=$idd and visible=1 order by code");
$qa=mysql_fetch_row($q);
while ($qa) {
echo "
\n";
$qa=mysql_fetch_row($q);
}
mysql_free_result($q);
}
}
?>
|
|
помощь | расширенный поиск |
|
 |
$q=mysql_query("select idd, name, idpd from d where idd=$idd");
$qa=mysql_fetch_row($q);
mysql_free_result($q);
if ($qa) {
$idpd_=$qa[2];
} else {
$idpd_=-1;
}
switch ($idpd_) {
case -1: $q=mysql_query("select d.idd, d.name, t.idt, t.name, t.country from d, t where d.idd=t.idd and t.picst<>'' and t.a=3 and d.visible=1 and t.visible=1");
break;
case 0 : $q=mysql_query("select d.idd, d.name, t.idt, t.name, t.country from d, t where d.idpd=$idd and d.idd=t.idd and t.a>=2 and d.visible=1 and t.visible=1");
break;
default: $q=mysql_query("select d.idd, d.name, t.idt, t.name, t.country from d, t where d.idd=$idd and d.idd=t.idd and t.a>=1 and d.visible=1 and t.visible=1");
break;
}
$qa=mysql_fetch_row($q);
if (!$qa) {
mysql_free_result($q);
switch ($idpd_) {
case -1: $q=mysql_query("select d.idd, d.name, t.idt, t.name, t.country from d, t where d.idd=t.idd and picst<>'' and d.visible=1 and t.visible=1 limit 3");
break;
case 0 : $q=mysql_query("select d.idd, d.name, t.idt, t.name, t.country from d, t where d.idpd=$idd and d.idd=t.idd and d.visible=1 and t.visible=1 limit 3");
break;
default: $q=mysql_query("select d.idd, d.name, t.idt, t.name, t.country from d, t where d.idd=$idd and d.idd=t.idd and d.visible=1 and t.visible=1 limit 3");
break;
}
$qa=mysql_fetch_row($q);
}
while ($qa) {
$q1=mysql_query("select v1,v2,v3,v4,v5,v6,v7,v8 from m where idt=$qa[2] and visible=1 limit 1");
$q1a=mysql_fetch_row($q1);
mysql_free_result($q1);
$charact="";
for ($i=0;$i<=7;$i++) {
if (!empty($q1a[$i])) $charact.=", ".$q1a[$i];
}
echo "
";
$qa=mysql_fetch_row($q);
}
mysql_free_result($q);
?>
|
|
cпецпредложения |
|