<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[[PHP] Algoritmo per Aste al ribasso]]></title><description><![CDATA[<p dir="auto">Ciao, sto cercando di creare un piccolo script per le aste al ribasso, ma non so' come rendere l'algoritmo il più veloce possibile.</p>
<p dir="auto">L'argotimo deve vedere se l'offerta dell'utente ($user_bid) è l'offerta unica più bassa presente nel db.</p>
<p dir="auto">Il db è strutturato così:<br />
id | user_bid | item | bid</p>
]]></description><link>https://dev.connect.gt/topic/83846/php-algoritmo-per-aste-al-ribasso</link><generator>RSS for Node</generator><lastBuildDate>Tue, 01 Dec 2026 20:52:47 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/83846.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 28 Sep 2008 18:36:04 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [PHP] Algoritmo per Aste al ribasso on Sun, 12 Oct 2008 12:21:42 GMT]]></title><description><![CDATA[<p dir="auto">Non mi funziona. Mi dà errore di sintassi.</p>
<p dir="auto">up</p>
]]></description><link>https://dev.connect.gt/post/763987</link><guid isPermaLink="true">https://dev.connect.gt/post/763987</guid><dc:creator><![CDATA[x3d0]]></dc:creator><pubDate>Sun, 12 Oct 2008 12:21:42 GMT</pubDate></item><item><title><![CDATA[Reply to [PHP] Algoritmo per Aste al ribasso on Mon, 29 Sep 2008 17:25:21 GMT]]></title><description><![CDATA[<p dir="auto">In un'altro forum mi hanno suggerito:</p>
<p dir="auto">function offertaVincente( $user_bid,  $item ){</p>
<p dir="auto">$query = "SELECT  * from nomeTabella AS T1<br />
WHERE T1.user_bid = $user_bid AND T1.item = $item<br />
AND T1.bid &lt;= ALL ( SELECT T2.bid FROM nometabella AS T2<br />
WHERE T1.item = T2.item AND T1.user_bid != T2.user_bid ) //è lofferta più bassa fatta sul determinato oggetto<br />
AND NOT EXISTS ( SELECT * from nometabella AS T3    //ed è anche l'unica<br />
WHERE T1.item = T3.item AND T3.bid &lt; T1.bid );";</p>
<p dir="auto">$res = mysql_query($query);</p>
<p dir="auto">if ( mysql_affected_rows( $res ) &gt; 0 )<br />
return true;</p>
<p dir="auto">return false;</p>
<p dir="auto">}</p>
<p dir="auto">Quale delle due potrebbe essere più soddisfacente?</p>
]]></description><link>https://dev.connect.gt/post/763986</link><guid isPermaLink="true">https://dev.connect.gt/post/763986</guid><dc:creator><![CDATA[x3d0]]></dc:creator><pubDate>Mon, 29 Sep 2008 17:25:21 GMT</pubDate></item><item><title><![CDATA[Reply to [PHP] Algoritmo per Aste al ribasso on Mon, 29 Sep 2008 09:50:14 GMT]]></title><description><![CDATA[<p dir="auto">SELECT count(id) AS tot, * FROM table GROUP BY user_bid, bid HAVING tot=1 ORDER BY bid LIMIT 1</p>
<p dir="auto">Questo ti restituisce l'offerta unica più bassa.<br />
e ti interessa per un singlo utente basta aggiungere WHERE user_bid="miouser"<br />
Se non ti restituisce niente allora non è l'offerta unica piu bassa.</p>
]]></description><link>https://dev.connect.gt/post/763985</link><guid isPermaLink="true">https://dev.connect.gt/post/763985</guid><dc:creator><![CDATA[ayrton2001]]></dc:creator><pubDate>Mon, 29 Sep 2008 09:50:14 GMT</pubDate></item></channel></rss>