Merhaba arkadaşlar
next ve previous sorunu olarak daha önce önünüze gelen sorunumu sonunda dün akşam aşmış bulunmaktayım

fakat şimdi farklı bir
sorun ile karşı karşıyayım... aşağıdaki imajlar ile elimden geldiğince sorunumu anlatmaya çalışayım
http://www.designsofme.com/hayalmahs...si/urunler.jpg
adresinde görüleceği üzere 5 hane ürün bilgim var.. ürünler benim belirlediğim en sağdaki siraid ile sıralanıyorlar... buraya kadar tamam
http://www.designsofme.com/hayalmahs...fisi/detay.jpg
burada görüleceği üzere de bir ürünün detayı 2-3 hane ile dolduruluyor...
http://www.designsofme.com/hayalmahs...fisi/sayfa.jpg
fakat asıl
sorun burada... ürünün id'sine bağlı olarak ürün özellikleri gelmesi gerekirken, bilgi bulunamadığı zaman çıkması gereken "there is no data" ibaresini alıyorum...
kod'um aşağıdaki şekilde düzenlenmiştir.. :
<table width="329" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="329" height="90" align="right" valign="top">
<table width="143" height="30" border="0" cellpadding="0" cellspacing="0" bgcolor="#FF0000">
<tr>
<td align="center" valign="middle" class="tepebaslik">
<?PHP
if(strlen($sh)<1){
// sh means SECTION HEADERorder
echo "Mainpage";
}
else {
echo $sh;
}
?>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center" valign="top" class="maintext">
<?PHP
if($cid=='cat'){
// cid means CONTENT ID
echo '<table width="329" border="0" cellspacing="0" cellpadding="0">';
mysql_connect("localhost", "root", "root") or die("dbase Conneciton Failed!");
mysql_select_db("bishop");
if(strlen($next)<1){
$next=0;
}
$query="SELECT * FROM items where cat_id=".$cat_id." order by siraid";
$result = mysql_query($query);
$count=0;
$count2=0;
// bir sayfada kac item listelenecegini page_limit belirliyor
$page_limit=12;
while ($row = mysql_fetch_array($result)) {
//if($count2==0){
//}
if($next<=$row[5]){
if($count==$page_limit){
$next_link="<a href='index.PHP?sh=".$sh."&cid=cat&cat_id=".$cat_id."&next=".$row[5]."' class='duzyazilink'>Next »</a>";
break;
}
if(($count%3)==0){
echo '<tr align="center" valign="top">';
}
echo '<td width="105" align="center" valign="top" class="uruntext"><a href="index.PHP?sh='.$sh.'&cid=item&item_id='.$row[5].'&cat_id='.$cat_id.'" class="urunlink"><img src="'.$row[3].'" border="0"><br><img src="i/trans.gif" border="0" height="5" width="50"><br>'.$row[1].'</a><br><br>';
if(($count%3)==0){
echo '</tr>';
}
$count++;
}
if(($count2%$page_limit)==0){
if($row[5]<$next)
$prev=$row[5];
}
if(isset($prev)){
$prev_link="<a href='index.PHP?sh=".$sh."&cid=cat&cat_id=".$cat_id."&next=".$prev."' class='duzyazilink'>« Previous</a>";
}
$count2++;
}
if($count==0){
echo "There is no data...";
}
mysql_free_result($result);
mysql_close();
echo "<tr><td align='left' colspan='3'><table width='100%' cellspacing='0' cellpadding='0'><tr>";
if(strlen($prev)>0){
echo "<td align='left' width='50%'>".$prev_link."</td>";
}
echo "<td align='right' width='50%'>".$next_link."</td>";
echo "</tr></table></td></tr>";
echo '</table>';
}
else if($cid=='item'){
mysql_connect("localhost", "root", "root") or die("dbase Conneciton Failed!");
mysql_select_db("bishop");
$query="SELECT * FROM items where siraid=".$item_id;
$result = mysql_query($query);
$count=0;
$item_name="";
$item_large_img="";
while ($row = mysql_fetch_array($result)) {
$item_name=$row[1];
$item_large_img=$row[4];
$count++;
}
if($count==0){
echo "No files found...";
exit;
}
echo '
<table width="329" border="0" cellspacing="0" cellpadding="0">
<tr align="center" valign="top">
<td width="105" align="center" valign="top" class="uruntext">
<!-- BUYUK RESIM BASLA -->
<table width="329" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="3"><img src="'.$item_large_img.'" width="334" height="242"></td>
</tr>
<tr>
<td width="68" height="36"><img src="i/trans.gif" width="68" height="36" border="0"></td>
<td width="256" height="36" align="center" valign="top" background="i/detay_kapama.gif" class="baslik"><img src="i/trans.gif" height="4" width="150" border="0"><br>'.$item_name.'</td>
<td width="10" height="36"><img src="i/trans.gif" width="10" height="36" border="0"></td>
</tr>
</table>
<!-- BUYUK RESIM BIT -->
</td>
</tr>
<tr align="center" valign="top">
<td align="center" valign="top" class="uruntext"><img src="i/trans.gif" width="1" height="20" border="0"></td>
</tr>
<tr align="center" valign="top">
<td align="left" valign="top" class="uruntext">
';
$query="SELECT * FROM item_detail where item_id=".$item_id." order by orderance";
$result = mysql_query($query);
$count=0;
while ($row = mysql_fetch_array($result)) {
if($count==0){
echo '
<!-- OZELLIKLER BASLA -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">';
}
echo '
<tr>
<td width="80" height="30" align="left" class="maintextbold" valign="top">'.$row[1].'</td>
<td width="10" height="30" align="left" class="maintextbold" valign="top">:</td>
<td height="30" align="left" class="maintext" valign="top">'.$row[2].'</td>
</tr>';
$count++;
}
if($count==0){
echo "There is no data...";
}
else{
echo '
</table>
<!-- OZELLIKLER BIT -->';
}
mysql_free_result($result);
$query="select siraid from items where cat_id=".$cat_id.' order by siraid';
$result = mysql_query($query);
while ($row = mysql_fetch_array($result)){
if($row[0]<$item_id){
$pre_id=$row[0];
$pre_link='<a href="index.PHP?sh='.$sh.'&cid=item&item_id='.$pre_id.'&cat_id='.$cat_id.'" class="duzyazilink">« Previous</a>';
}
}
mysql_free_result($result);
$result = mysql_query($query);
while ($row = mysql_fetch_array($result)){
if($row[0]>$item_id){
$next_id=$row[0];
$next_link='<a href="index.PHP?sh='.$sh.'&cid=item&item_id='.$next_id.'&cat_id='.$cat_id.'" class="duzyazilink">Next »</a>';
$next_link2='</a>';
break;
}
}
echo '</td>
</tr>
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="60">
<tr>
<td align=left width="50%" class="maintext">'.$pre_link.'</td>
<td align=right width="50%" class="maintext">'.$next_link.'</td>
</tr>
</table>
</td>
</tr>
</table>';
mysql_free_result($result);
mysql_close();
?>
<?PHP
}
else if($cid=='static'){
include($staticname);
}
else{
?>
<p align="justify"><img src="i/anasayfa_resim.jpg" width="329" height="158"><br>
<img src="i/trans.gif" width="329" height="5"> Bishop was established
in 1997 to introduce to the rapidly growing interior design industry<br>
<br>
in Turkey the elements of cutting edge furniture and lighting design.
In our vast showroom located in Nisantasi, the upscale design district
of Istanbul, we feature among others<br>
<br>
lighting and accessories conceived by Poul Henningsen, Arne Jacobsen,
Eric Magnussen and Holger Strom.<br>
<br>
Despite its short history, Bishop quickly became the leading interior
design store in Istanbul specializing in new design and modern classics.
In our showroom we further represent an array of works by upcoming Turkish
designers. Our design team's lighting concepts have been implemented in
numerous restaurant, hotel, office and residential projects all over Turkey.
Using simple forms with a touch of flare, Bishop Designs adapt to every
space and suit specific applications.<br>
<br>
In the last 4 years, we have extended our scope and services into manufacturing
of lighting and furniture, and have gained the respect of acclaimed designers
in Turkey as well as in Europe with our products. The production workshops
of Bishop are able to meet the high standarts of designers in quality
and detailing, and can work with various different materials such as plexiglass,
metal(aluminum, chrome, brass etc.), recycled paper, polypropylene and
various fabrics. Besides batch production capabilities, we can also offer
consulting during design and sampling stage.<br>
To the domestic and contract clients as well as the designer, Bishop can
offer many advantages all at the same time: <br>
<br>
<table width="100%" border="0" cellspacing="0" cellpadding="5">
<tr>
<td width="20" align="center" valign="top" class="maintext">-</td>
<td align="left" valign="top" class="maintext">Energetic and young ownership
and staff with a keen understanding of the current design world.</td>
</tr>
<tr>
<td width="20" align="center" valign="top" class="maintext">-</td>
<td align="left" valign="top" class="maintext">Creative solutions which
can be implemented in new design ideas.</td>
</tr>
<tr>
<td width="20" align="center" valign="top" class="maintext">-</td>
<td align="left" valign="top" class="maintext">The ability to manufacture
quality products for the designer at very competitive prices.</td>
</tr>
<tr>
<td width="20" align="center" valign="top" class="maintext">-</td>
<td align="left" valign="top" class="maintext">The flexibility to create
samples or difficult molds for new ideas.</td>
</tr>
<tr>
<td width="20" align="center" valign="top" class="maintext">-</td>
<td align="left" valign="top" class="maintext">The experience in lighting
design and manufacture of bar, hotel, nightclub and restaurant projects.</td>
</tr>
</table>
</p>
<?PHP } ?>
</td>
</tr>
<tr>
<td align="center" valign="top" class="maintext" height="20"><img src="i/trans.gif" width="1" height="20" border="0"></td>
</tr>
</table>
bu dosya icerik.
PHP... herşey bu dosya üzerinde gerçekleşio.. ürün listeleme de, ürün detayı alma da...
benim mantığıma göre olmaıs gereken şöyle..
şu anda ürünler listelenirken bir ürünün detayına girmek için kullanılan link bu..
Kod:
<a href="index.PHP?sh='.$sh.'&cid=item&item_id='.$row[5].'&cat_id='.$cat_id.'" class="urunlink">
buna göre item id'si items'in içindeki row5'e eşit olana git diyo, değil mi ?
fakat ürünün detayında ise
$query="SELECT * FROM items where siraid=".$item_id;
ile başlayan satır bana items'in içindeki siraid'si item id'ye eşit olanları al dio...
(iyice karıştırdım biliom

)
benim istediğim, yukardaki kod içinde nası bi değişiklik yapmam gerekirki, ürünler sira id ile listelenirken detayına girince sira id'si geldiği sayfadaki id ile örtüşen (bu nası bi kelimeyse) ürünün detayı bana gelsin ? (vöh!)
anlatamadım büyük ihtimal.. beni anlıycak bi babayiğit war mı
şimdiden teşekkürler