Juhu,
könnt mir einer helfen bzw. sagen wie ich in einer Box die letzten 5 awards anzeigen lassen kann ? wo eventuell bei platz 1,2 oder ein pokal angezeigt wir?
brauchte nur ein script ohne bilder etc
betroffene Homepage: externer Link
Hier kann eine Notiz zum Merk-Eintrag hinzugefügt werden (optional)
Geschlossen |
<?php defined ('main') or die ( 'no direct access' ); $abf = "SELECT platz, text, wofur, team, bild, DATE_FORMAT(time, "%d.%m.%Y") as zeit FROM `prefix_awards` ORDER BY time DESC LIMIT 0,3"; $erg = db_query($abf); echo'<table border="0" class="news" width="100%" cellspacing="0" cellpadding="0">'; while ($row = db_fetch_object($erg)) { $class = ( $class == 'Cmite' ? 'Cnorm' : 'Cmite' ); if ($row['bild'] != '' AND trim($row['bild']) != 'http://') { $row['bildutime'] = '<span style="float: left; margin-right: 10px;"><img src="'.$row['bild'].'" alt="'.$row['wofur'].'" title="'.$row['wofur'].'"/><br /><font class="smalfont">'.$row['zeit'].'</font></span><br />'; } else { $row['bildutime'] = $lang['date'].': '.$row['zeit'].'<br />'; } $row['class'] = $class; } echo '<tr><td>'.$row['bildutime'].' </td></tr></table>'; ?>
<?php defined ('main') or die ( 'no direct access' ); $erg = db_query('SELECT platz, text, wofur, team, bild, DATE_FORMAT(time, "%d.%m.%Y") as time FROM `prefix_awards` ORDER BY time DESC LIMIT 0,5'); echo'<table border="0" class="news" width="100%" cellspacing="0" cellpadding="0">'; while ($row = db_fetch_object($erg) ) { if ($row->bild != '' AND trim($row->bild) != 'http://') { $row->bildutime = '<span style="float: left; margin-right: 10px;"><img src="'.$row->bild.'" alt="'.$row->wofur.'" title="'.$row->wofur.'"/><br /><font class="smalfont">'.$row->time.'</font></span><br />'; } else { $row->bildutime = $lang['date'].': '.$row->time.'<br />'; } echo '<tr><td>'.$row->bildutime.' </td></tr></table>'; } ?>
<?php defined ('main') or die ( 'no direct access' ); $erg = db_query('SELECT platz, text, wofur, team, bild, DATE_FORMAT(time, "%d.%m.%Y") as zeit FROM `prefix_awards` ORDER BY time DESC LIMIT 0,3'); while ($row = db_fetch_object($erg) ) { if ($row->bild != '' AND trim($row->bild) != 'http://') { $row->bildutime = '<span ><img src="'.$row->bild.'" alt="'.$row->wofur.'" title="'.$row->wofur.'"/><br /><font class="smalfont">'.((strlen($row->team)<14) ? $row->team : substr($row->team,0,14).'...').'</font></span><br />'; } else { $row->bildutime = $lang['date'].': '.$row->team.'<br />'; } echo'<table border="0" class="news" width="217" cellspacing="0" cellpadding="0">'; echo '<tr><td><table width="217" style="border: 1px solid #d4d4d4" cellspacing="0" cellpadding="0">'; echo '<tr>'; echo ' <td width="100" align="center"><strong>'.$row->bildutime.'</strong> </td>'; echo ' <td width="117">Platz:<strong> '.$row->platz.''.$row->time.'</strong><br>'.((strlen($row->wofur)<16) ? $row->wofur : substr($row->wofur,0,13).'...').'</td>'; echo ' </tr>'; echo '</table>'; echo '</td></tr> '; echo '</table>'; } $erg1 = db_query('SELECT platz, text, wofur, team, bild, DATE_FORMAT(time, "%d.%m.%Y") as zeit FROM `prefix_awards` ORDER BY time DESC'); $num_rows = mysql_num_rows($erg1); echo '<span style="font-size:9px;margin-top:5px;">'.$num_rows.' Awards insgesamt</span>'; ?>
$qry = db_query("SELECT COUNT(platz) AS anzahl, platz FROM prefix_awards GROUP BY platz"); $platz = array(); while ($r = db_fetch_assoc($qry)) { $platz[$r['platz']] = $r['anzahl']; }
MySQL Error: 1140 : Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause in Query: SELECT COUNT(platz) as anzahl, platz FROM ic1_awards Debug backtrace: @ mysql.php:32 -- debug_bt() @ mysql.php:50 -- db_check_error(...) @ awards.php:14 -- db_query(...) @ design.php:330 -- require_once(...) @ design.php:172 -- design->get_boxcontent(...) @ design.php:69 -- design->replace_boxes(...) @ news.php:12 -- design->design(...) @ index.php:24 -- require_once(...)
$uid = $_SESSION['authid']; $punkte =db_query'("UPDATE `prefix_user´ set punkte = punkte+10 WHERE id = '.$uid.')';
function givePoints($uid, $points = 5) { if (!is_int($points) or !is_int($uid)) return; db_query("UPDATE prefix_user SET points = points + ".$points." WHERE id = ."$uid); }
function givePoints($uid, $points = array() ) { if (!is_int($points) or !is_int($uid)) return; db_query("UPDATE prefix_user SET points = points + ".$points." WHERE id = ."$uid); }
Sorry fürn doppelpost!!
function givePoints($uid, $points = 5) { if (!is_int($points) or !is_int($uid)) return; db_query("UPDATE prefix_user SET points = points + ".$points." WHERE id = ."$uid); }
function stealPoints($uid, $points = 5) { if (!is_int($points) or !is_int($uid)) return; db_query("UPDATE prefix_user SET points = points - ".$points." WHERE id = ."$uid); }
if ($um == 'insert') { // insert
givePoints($_SESSION['authid'], 10);
Geschlossen | ||
Zurück zu HTML, PHP, SQL,... |