<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<title>[Db] Problemino &gt;&lt;</title>
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
p
        {mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.StileMessaggioDiPostaElettronica18
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:70.85pt 2.0cm 2.0cm 2.0cm;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=IT link=blue vlink=blue>

<div class=Section1>

<p><font size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>Graz
ha scritto:<br>
<br>
<o:p></o:p></span></font></p>

<p><font size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>&gt;</span></font><font
size=2><span style='font-size:10.0pt'>Tuttavia se inserisco questa invece<br>
<font color=navy><span style='color:navy'>&gt;</span></font>$nome2 =
$db-&gt;get_var(&quot;SELECT titolo FROM collection WHERE posid &lt; '$posid'<br>
<font color=navy><span style='color:navy'>&gt;</span></font>AND
anno='$catid'&quot;);<br>
<font color=navy><span style='color:navy'>&gt;</span></font>non mi da, come
dovrebbe, il titolo dlel'articolo della precedente<br>
<font color=navy><span style='color:navy'>&gt;</span></font>posizione, ma bensė
il titolo del primo articolo presente, ovvero quello<br>
<font color=navy><span style='color:navy'>&gt;</span></font>nella posizione pių
bassa di tutte.<br>
<br>
<font color=navy><span style='color:navy'>aggiungi alla query un &#8220;Order
By posid desc&#8221;<o:p></o:p></span></font></span></font></p>

<p><font size=2 color=navy face="Times New Roman"><span style='font-size:10.0pt;
color:navy'>La query che fai adesso estrae tutti i record con posid inferiore a
$posid č quindi normale che ti restituisca il primo dell&#8217;elenco.<o:p></o:p></span></font></p>

<p><font size=2 color=navy face="Times New Roman"><span style='font-size:10.0pt;
color:navy'>Tieni presente comunque che anche la prima query che fai non estrae
1 solo record ma ne estrae N, il fatto che il primo record che ti restituiscono
č il record che ti serve  č solo una questione di ordinamento. <o:p></o:p></span></font></p>

<p><font size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:
Arial;color:navy'>Buon lavoro <o:p></o:p></span></font></p>

<p><font size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:
Arial;color:navy'>Giuseppe<o:p></o:p></span></font></p>

</div>

</body>

</html>
<html>
<BR><BR>
<TABLE width=400><HR>
<P style="FONT: 9pt/11pt verdana"><a href="http://www.avast.com">avast! Antivirus</a>: In arrivo messaggio pulito.
<P style="FONT: 8pt/11pt verdana">Virus Database (VPS): 000758-0, 19/07/2007<BR>Controllato il: 20/07/2007 15.34.24<BR><FONT color=gray>avast! - copyright (c) 1988-2007 ALWIL Software.</FONT></P>
<TBODY></TBODY></TABLE>
<BR><html>
<BR><BR>
<TABLE width=400><HR>
<P style="FONT: 9pt/11pt verdana"><a href="http://www.avast.com">avast! Antivirus</a>: In partenza messaggio pulito.
<P style="FONT: 8pt/11pt verdana">Virus Database (VPS): 000758-0, 19/07/2007<BR>Controllato il: 20/07/2007 15.44.01<BR><FONT color=gray>avast! - copyright (c) 1988-2007 ALWIL Software.</FONT></P>
<TBODY></TBODY></TABLE>
<BR></html>